Complete the code to mount the Docker socket inside the Jenkins container.
docker run -d -v [1]:/var/run/docker.sock jenkins/jenkinsThe Docker socket on the host is mounted inside the container at the same path to allow Docker commands inside the container.
Complete the Docker Compose service to mount the Docker socket for Jenkins.
services:
jenkins:
image: jenkins/jenkins
volumes:
- [1]:/var/run/docker.sockIn Docker Compose, the volume mount is specified as host_path:container_path. Here, the container path is already specified, so only the host path is needed.
Fix the error in the Docker run command to correctly mount the Docker socket.
docker run -d -v [1] jenkins/jenkinsThe volume mount must specify both host and container paths separated by a colon, and both paths must be the Docker socket path.
Fill both blanks to mount the Docker socket and set the correct environment variable for Jenkins.
docker run -d -v [1]:/var/run/docker.sock -e [2]=unix:///var/run/docker.sock jenkins/jenkins
The Docker socket must be mounted from the host path /var/run/docker.sock. The environment variable DOCKER_HOST tells Jenkins where to find the Docker daemon.
Fill all three blanks to create a Docker Compose service for Jenkins with Docker socket mounting and environment variable.
services:
jenkins:
image: jenkins/jenkins
volumes:
- [1]:/var/run/docker.sock
environment:
- [2]=[3]The Docker socket is mounted from the host path. The environment variable DOCKER_HOST is set to the Docker daemon address.