Settings

Theme

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

9 points by dvnguyen 3 years ago · 8 comments · 1 min read

Reader

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?

ashishbijlani 3 years ago

Take a look at Nestybox's DID use case [1]. They got acquired by Docker

1. https://blog.nestybox.com/2019/11/11/docker-sandbox.html

amir734jj 3 years ago

dind: https://hub.docker.com/_/docker

Example: https://gitlab.com/hesamian/milwaukee-internationals-dotnet/...

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.

fuero 3 years ago

Podman https://podman.io/ works fine, I use it to build container images on Kubernetes.

  • dvnguyenOP 3 years ago

    Do you run Docker inside Podman, Podman inside Docker, or Podman inside Podman?

pbalau 3 years ago

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).

quickthrower2 3 years ago

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?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection