Questions tagged [docker-in-docker]

Docker-in-Docker (DinD) is an unusual approach to run Docker containers by running a nested Docker daemon inside another container.

"Docker-in-Docker" (DinD) is an unusual approach to running Docker containers: instead of using docker run normally, an operator can run the Docker Hub docker image to run a second Docker daemon inside a container, and then launch containers inside that nested Docker daemon.

For most practical purposes, if a container needs to launch another container, it can use the host's Docker socket

docker run -v /var/run/docker.sock:/var/run/docker.sock ...

This approach is sometimes referred to as "Docker-out-of-Docker", in contrast to the nested Docker-in-Docker setup.

Jérôme Petazzoni's blog post Using Docker-in-Docker for your CI or testing environment? Think twice. describes some of the advantages and challenges of a DinD setup. That post notes:

The primary purpose of Docker-in-Docker was to help with the development of Docker itself. Many people use it to run CI (e.g. with Jenkins), which seems fine at first, but they run into many “interesting” problems that can be avoided by bind-mounting the Docker socket into your Jenkins container instead.

Some CI systems, notably , have native DinD support. Consider tagging your question with both and a CI-specific tag if your question is about setting up a DinD-based CI system.

The tag should be used on questions about a DinD setup. It does not describe questions about sharing the host's Docker socket. In most cases these questions will also be tagged with . Remember that Stack Overflow questions must be programming related: questions about setting up CI systems or copying images between Docker daemons are likely not on-topic.

276 questions
0
votes
1 answer

Routing between Kubernetes cluster and Docker container in the VM

I have setup Kubernates cluster in the VM (Ubuntu 18.04.1 LTS) on the Azure cloud using preconfigured scripts. MongoDB docker container is running along with K8s cluster. My aim is to connect MongoDB to CMS container which is running inside the…
Ramesh Murugesan
  • 4,727
  • 7
  • 42
  • 67
0
votes
1 answer

Docker golang client within docker container

I am trying to use the docker go client to connect to the google container registry to list and delete images. My golang application also exists in a docker container. This is the dockerfile for my golang application: FROM docker:latest USER…
KcinnaY
  • 73
  • 1
  • 9
0
votes
1 answer

Can you deploy Docker-in-Docker to the Heroku Platform?

I have been experimenting with building and pushing Docker images to the Heroku container registry, then releasing them like so: heroku container:login heroku create some-app-name heroku container:push web --app some-app-name heroku…
kshah
  • 1,667
  • 2
  • 16
  • 24
0
votes
1 answer

Docker. ERROR: Uploading artifacts to coordinator. timeout awaiting response headers

I try to prepare large artifact file (about 1 GB). But I stuck with next error: ... Stopping my_mysql ... done $ docker run --rm --volumes-from my_mysql carinamarina/backup backup --source /var/lib/mysql/ --stdout --zip >…
Nick
  • 9,735
  • 7
  • 59
  • 89
0
votes
1 answer

Parent Docker Containers using Docker in Docker

I am working on a jenkins ssh agent for my builds I want to have docker installed so it can run and build docker images I currently have the following in my Dockerfile RUN curl -fsSL get.docker.com -o /opt/get-docker.sh RUN chmod +x…
jaekie
  • 2,283
  • 4
  • 30
  • 52
0
votes
0 answers

Loading images into docker-in-docker (dind) running in k8s

So I have docker-in-docker running as a sidecar in a pod with /var/lib/docker pointed to emptyDir: {}. I need to load a couple of images into it after it comes up to have it work as I need it to. I can docker save them from my repo and move them to…
aatk
  • 160
  • 1
  • 7
0
votes
1 answer

Building and pushing a docker image from inside a container

Context: I am using repo2docker to build images containing experiments, then to push them to a private registry. I am dockerizing this whole pipeline (cloning the code of the experiment, building the image, pushing it) with docker-compose. This is…
MasterScrat
  • 7,090
  • 14
  • 48
  • 80
0
votes
0 answers

passing docker swarm secret to sibling container

I have a docker swarm which I start with this compose file: version: "3.1" services: my_service: image: my_image volumes: - /var/run/docker.sock:/var/run/docker.sock - /run/secrets:/run/secrets secrets: -…
0
votes
1 answer

In which path does docker and docker-in-docker run its containers?

I have a dockerized nginx server which I can build and run on my local machine without any problems. So now I want to deploy this with the help of a gitlab runner. This is my simple dockerfile: FROM nginx COPY web /usr/share/nginx/html EXPOSE…
Ipsider
  • 553
  • 1
  • 7
  • 20
0
votes
1 answer

Networking using docker-compose in docker executor in circleci

this is a circleci question I guess. I am quite happy with circleci but now I ran into a problem and I don't know what I'm doing wrong. Maybe this is something very easy, but I don't see the it. In short I can't make containers talk to each other on…
0
votes
1 answer

Is it possible to start real docker daemon in docker?

I need to run docker inside of another docker for some reason. Mapping docker.socket is not an option, I need real docker daemon to start within docker. Does anybody know if this is possible?
Oleg
  • 575
  • 4
  • 13
0
votes
1 answer

Why Docker Build Fails in Docker in Docker Jenkins Build: ‘/proc/1/map_files’: Operation not permitted

The instruction below is correctly built in MacOS Docker Engine 18.04 while the same instruction fails when built in by a Jenkins Container running Docker (Docker-in-Docker, dind, Inception)... Why is the reason for the error and what's the…
Marcello DeSales
  • 21,361
  • 14
  • 77
  • 80
0
votes
2 answers

Docker in Docker separate container storage

I am running a Jenkins instance on a virtual machine (Note: not in a container, from now on called "Host"). During a Jenkins build I am spinning up a container (from now on called "Builder") on the "Host", which mounts the docker socket from the…
stiller_leser
  • 1,512
  • 1
  • 16
  • 39
0
votes
3 answers

Docker in Docker(DND) is not starting

I have a simple Ubuntu 16.10 container which has docker.io installed. The docker process terminates after it starts and log has this information. Any troubleshooting suggestions? $ docker run -it --name dcos-ubuntu-python5 python-docker…
Senthil Kumaran
  • 54,681
  • 14
  • 94
  • 131
0
votes
1 answer

Running a docker command in docker build

I have an application which uses docker to build itself, and I want to build a docker image of it. This requires exposing the docker.sock to the application during the docker build command (similar to adding a -v…
Ron
  • 1,989
  • 2
  • 17
  • 33
1 2 3
18
19