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
0 answers

Permission denied error while running Docker outside of Docker (DinD alternative)

I am trying to run a docker container which will allow me to have access to Docker daemon of the host machine (Docker outside of Docker approach). I am planning to run this container in a specific docker network and access the docker daemon via a…
0
votes
1 answer

Connecting to detached container in gitlab CI pipeline

Cannot connect to detached container from Gitlab's CI I start detached docker container being an HTTP server and try to connect to it from the pipeline script, but get connection error: curl: (28) Failed to connect to 172.17.0.3 port 9000 after…
0
votes
1 answer

Got `GLIBC_2.32' and `GLIBC_2.34' not found in Jenkins (Docker) with docker socket mounted on Ubuntu 22.04

I am trying to mount docker into a docker container, it used to work with WSL on Windows, but now that I am on Linux (Ubuntu 22) I am having this error when trying to use docker from the container. Output when using docker on the…
0
votes
0 answers

Update feature for nodejs app running on docker swarm

I am running a nodejs app on Docker swarm and I want to implement an update page where the user can upload the update files and the app should run with the updated version, without dealing with the command line. My initial thought was to let users…
ybalcanci
  • 93
  • 1
  • 7
0
votes
0 answers

Unable to run dind-rootless with a non-root user id

I am trying to run a multi-process container which has docker daemon and jupyter lab running as process inside it. For this, I am using s6-overlay to run jupyterlab as a service and specifying the dockerd-entrypoint.sh as the executable command. My…
bornidiot
  • 1
  • 2
0
votes
0 answers

Can't get the gitlab-runner to execute docker-in-docker

I have GitLab community edition running in an AWS EKS, kubernetes cluster. I'm using helm to manage it. I have been trying to get docker-in-docker (dind) working in my runner. I think I have a problem with my values.yaml file, but I can't figure…
Rob Wing
  • 1
  • 2
0
votes
0 answers

how do I use dind as a base image in my dockerfile without overriding the base image's CMD command

I am trying to run a docker container which needs to: Have docker running inside it Run jupyterlab For this, I am trying to use docker:dind as the base image in my dockerfile and the install and run jupyterlab seperately. This is what my…
0
votes
1 answer

How to replace `securityContext: privileged: true` in Kubernetes for DinD (docker in docker)

If we want to to build OCI container images with docker and e.g. want to the following pod setup: apiVersion: v1 kind: Pod metadata: name: dind spec: containers: - name: build image: docker:23.0.1-cli command: - cat …
Gabriel
  • 8,990
  • 6
  • 57
  • 101
0
votes
0 answers

TeamCity: teamcity-agent:2022.10.2-linux-sudo - cgroup permission denied and "Is the docker daemon running?" error

I have the following docker compose file for my teamcity agents: services: teamcity-agent-1: image: jetbrains/teamcity-agent:2022.10.2-linux-sudo container_name: teamcity-agent-1 restart: always privileged: true user: 0:0 …
0
votes
0 answers

Docker in Docker dind connecting to ddev container within compose network from host maschine

I'm currently working on setting up a ddev typo3 webpage running in a ubuntu dind container to get around the installation requirements for ddev on windows. I have previously tested connecting to an nginx container within the dind container, which…
0
votes
0 answers

Docker compose within Gitlab pipeline / docker in docker and volume sharing

The project I am working on consists of multiple components, written in C#/.NET6, and deployed as docker containers on a Linux host. Each component has his own git repository on Gitlab and its Gitlab pipeline is building the docker container to the…
EricBDev
  • 1,279
  • 13
  • 21
0
votes
1 answer

GitLab, dind and docker-compose and unkown flag c (context)

I maked pipeline in GitLab with docker:20.10-dind image. When i tried run: - docker-compose -c remote pull best-ever-app I saw next: unknown shorthand flag: 'c' in -c If I use --context same thing. I tried to install docker-compose in image in…
KoKoKo
  • 1
  • 1
0
votes
1 answer

How to build a docker image inside Airflow

I want to deploy an application to Airflow that accepts a config file as a parameter, pulls the git repository specified by said config, then transforms it into a Docker image, then uploads that image to GCP's Artifact Registry. What is the best…
0
votes
0 answers

Unable to fix error Cannot connect to the Docker daemon at tcp://localhost:2375/. Is the docker daemon running? for remote GitLab runner

I am struggling to resolve the issue Cannot connect to the Docker daemon at tcp://localhost:2375/. Is the docker daemon running? I am using our companies GitLab EE instance, which comes with a bunch of shared group runners. However I would like to…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
0
votes
0 answers

start docker container from within self hosted bitbucket pipeline (dind)

I work on a spring-boot based project and use a local machine as test environment to deploy it as a docker container. I am in the middle of creating a bitbucket pipeline that automates everything between building and deploying. For this pipeline I…
tagtraeumer
  • 1,451
  • 11
  • 19