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.<p>What are good ways to run container inside container for development purpose?
Take a look at Nestybox's DID use case [1]. They got acquired by Docker<p>1. <a href="https://blog.nestybox.com/2019/11/11/docker-sandbox.html" rel="nofollow">https://blog.nestybox.com/2019/11/11/docker-sandbox.html</a>
dind: <a href="https://hub.docker.com/_/docker" rel="nofollow">https://hub.docker.com/_/docker</a><p>Example: <a href="https://gitlab.com/hesamian/milwaukee-internationals-dotnet/-/blob/master/.gitlab-ci.yml" rel="nofollow">https://gitlab.com/hesamian/milwaukee-internationals-dotnet/...</a><p>Run docker insider docker. I use this in gitlab.ci to build docker image and push the build docker image to docker hub/heroku docker image hub.
Podman <a href="https://podman.io/" rel="nofollow">https://podman.io/</a> works fine, I use it to build container images on Kubernetes.
There are two concepts here: running the docker daemon inside your host container AND running only the docker client inside the host container.<p>I never bothered with the first.<p>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).
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?