0
0
Jenkinsdevops~10 mins

Docker socket mounting in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to mount the Docker socket inside the Jenkins container.

Jenkins
docker run -d -v [1]:/var/run/docker.sock jenkins/jenkins
Drag options to blanks, or click blank then click option'
A/var/run/docker.sock:/var/run/docker.sock
B/var/run/docker.sock
C/docker.sock
D/var/run/docker
Attempts:
3 left
💡 Hint
Common Mistakes
Mounting only the path without the container path.
Using incorrect socket path.
Forgetting the colon separator.
2fill in blank
medium

Complete the Docker Compose service to mount the Docker socket for Jenkins.

Jenkins
services:
  jenkins:
    image: jenkins/jenkins
    volumes:
      - [1]:/var/run/docker.sock
Drag options to blanks, or click blank then click option'
A/var/run/docker
B/docker.sock
C/var/run/docker.sock
D/var/run/docker.sock:/var/run/docker.sock
Attempts:
3 left
💡 Hint
Common Mistakes
Including container path twice.
Using incorrect host path.
Using relative paths.
3fill in blank
hard

Fix the error in the Docker run command to correctly mount the Docker socket.

Jenkins
docker run -d -v [1] jenkins/jenkins
Drag options to blanks, or click blank then click option'
A/var/run/docker.sock
B/var/run/docker.sock:/var/run/docker.sock
C/var/run/docker.sock:/var/run/docker
D/docker.sock:/var/run/docker.sock
Attempts:
3 left
💡 Hint
Common Mistakes
Using mismatched paths.
Omitting the container path.
Using incorrect socket path.
4fill in blank
hard

Fill both blanks to mount the Docker socket and set the correct environment variable for Jenkins.

Jenkins
docker run -d -v [1]:/var/run/docker.sock -e [2]=unix:///var/run/docker.sock jenkins/jenkins
Drag options to blanks, or click blank then click option'
A/var/run/docker.sock
BDOCKER_HOST
Cdocker.sock
DDOCKER_SOCKET
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong environment variable name.
Mounting incorrect socket path.
Confusing volume mount syntax.
5fill in blank
hard

Fill all three blanks to create a Docker Compose service for Jenkins with Docker socket mounting and environment variable.

Jenkins
services:
  jenkins:
    image: jenkins/jenkins
    volumes:
      - [1]:/var/run/docker.sock
    environment:
      - [2]=[3]
Drag options to blanks, or click blank then click option'
A/var/run/docker.sock
BDOCKER_HOST
Cunix:///var/run/docker.sock
Ddocker.sock
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect volume mount syntax.
Wrong environment variable name or value.
Using relative paths instead of absolute.