TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

9 pointsby dvnguyenover 2 years ago
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?

5 comments

ashishbijlaniover 2 years ago
Take a look at Nestybox&#x27;s DID use case [1]. They got acquired by Docker<p>1. <a href="https:&#x2F;&#x2F;blog.nestybox.com&#x2F;2019&#x2F;11&#x2F;11&#x2F;docker-sandbox.html" rel="nofollow">https:&#x2F;&#x2F;blog.nestybox.com&#x2F;2019&#x2F;11&#x2F;11&#x2F;docker-sandbox.html</a>
amir734jjover 2 years ago
dind: <a href="https:&#x2F;&#x2F;hub.docker.com&#x2F;_&#x2F;docker" rel="nofollow">https:&#x2F;&#x2F;hub.docker.com&#x2F;_&#x2F;docker</a><p>Example: <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;hesamian&#x2F;milwaukee-internationals-dotnet&#x2F;-&#x2F;blob&#x2F;master&#x2F;.gitlab-ci.yml" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;hesamian&#x2F;milwaukee-internationals-dotnet&#x2F;...</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&#x2F;heroku docker image hub.
评论 #33463234 未加载
fueroover 2 years ago
Podman <a href="https:&#x2F;&#x2F;podman.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;podman.io&#x2F;</a> works fine, I use it to build container images on Kubernetes.
评论 #33469565 未加载
pbalauover 2 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.<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&#x27;m using this in our bitbucket pipelines (there is a setting in the pipeline config that mounts the socket for you).
评论 #33463874 未加载
quickthrower2over 2 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?