Ask HN: Ways to run container inside container for development purpose?

9 points by dvnguyen ↗ HN
I want to use containers as my development environment, but sometimes I need to use Docker. I’ve heard that running Docker inside container is a pain to set up.

What are good ways to run container inside container for development purpose?

8 comments

[ 37.0 ms ] story [ 905 ms ] thread
Docker compose? Compose your dev environment docker with other containers you need. Means you need to communicate with them over a local virtual network though. But that is probably OK for most things?
Podman https://podman.io/ works fine, I use it to build container images on Kubernetes.
Do you run Docker inside Podman, Podman inside Docker, or Podman inside Podman?
There are two concepts here: running the docker daemon inside your host container AND running only the docker client inside the host container.

I never bothered with the first.

For the second is enough to mount the docker socket from the HOST machine inside your host container (and obviously have the docker client available in your host container). I'm using this in our bitbucket pipelines (there is a setting in the pipeline config that mounts the socket for you).

(comment deleted)