Recall & Review
beginner
What is Docker socket mounting in the context of Jenkins?
Docker socket mounting means connecting the Docker engine's communication socket from the host machine into the Jenkins container. This allows Jenkins to run Docker commands directly on the host's Docker engine.
Click to reveal answer
beginner
Why do we mount the Docker socket into a Jenkins container?
Mounting the Docker socket lets Jenkins control Docker on the host. This means Jenkins can build, run, and manage Docker containers without installing Docker inside the Jenkins container itself.
Click to reveal answer
beginner
What is the typical Docker socket file path mounted into Jenkins?
The Docker socket file path is usually /var/run/docker.sock on the host. It is mounted into the Jenkins container at the same path to allow communication.
Click to reveal answer
intermediate
Show the Docker run command snippet to start Jenkins with Docker socket mounted.
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 jenkins/jenkins
Click to reveal answer
intermediate
What is a security consideration when mounting the Docker socket into Jenkins?
Mounting the Docker socket gives Jenkins full control over the Docker engine and host system. If Jenkins or its plugins are compromised, attackers can control the host. So, it should be done carefully with trusted code.
Click to reveal answer
What does mounting /var/run/docker.sock into Jenkins allow?
✗ Incorrect
Mounting the Docker socket allows Jenkins to communicate with the host's Docker engine and run Docker commands.
Which Docker run option mounts the Docker socket into a container?
✗ Incorrect
The -v option mounts volumes. Here it mounts the Docker socket file from host to container.
What risk comes with mounting the Docker socket into Jenkins?
✗ Incorrect
Mounting the Docker socket gives Jenkins full control over Docker on the host, which can be a security risk if Jenkins is compromised.
If you want Jenkins to build Docker images, what is a simple way to enable this?
✗ Incorrect
Mounting the Docker socket allows Jenkins to use the host's Docker engine to build images without installing Docker inside Jenkins.
What is the default path of the Docker socket on Linux hosts?
✗ Incorrect
The Docker socket is usually located at /var/run/docker.sock on Linux systems.
Explain how mounting the Docker socket helps Jenkins run Docker commands.
Think about how Jenkins talks to Docker without installing Docker inside itself.
You got /4 concepts.
Describe the security risks of mounting the Docker socket into Jenkins and how to mitigate them.
Consider what happens if someone bad controls Jenkins with Docker socket access.
You got /4 concepts.