Below is the code snippet of jenkins image taken from here:
# Install Docker Engine
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list && \
apt-get update -y && \
apt-get purge lxc-docker* -y && \
apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y && \
usermod -aG docker jenkins && \
usermod -aG users jenkins
that installs docker engine within jenkins image. My understanding is, var/run/docker.sock
is created withing Jenkins container, due to installation of docker engine.
Below is the volume mapping syntax taken from here:
volumes:
- jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
that launches jenkins container(above) on EC2 host.
EC2 host also has docker daemon running.
So, there is docker daemon running in EC2 host. There is also a docker daemon running within docker container(Jenkins)
With this syntax(/var/run/docker.sock:/var/run/docker.sock
) in docker-compose(above) for socket files,
Does docker daemon within Jenkins container override its own socket file with the socket file present in EC2 host? If yes... what is its implication?