Docker allows you to run Jenkins inside a container, which is like a small, isolated computer. This makes installation easy and consistent on any system.
Click to reveal answer
beginner
Which Docker command pulls the official Jenkins image?
The command is docker pull jenkins/jenkins:lts. It downloads the latest stable Jenkins image from Docker Hub.
Click to reveal answer
beginner
How do you start a Jenkins container with Docker?
Use docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts. This runs Jenkins and maps ports so you can access it in your browser.
Click to reveal answer
intermediate
Why map ports 8080 and 50000 when running Jenkins in Docker?
Port 8080 is for the Jenkins web interface. Port 50000 is for Jenkins agents to connect. Mapping them lets you use Jenkins normally outside the container.
Click to reveal answer
intermediate
How can you save Jenkins data when using Docker?
You use Docker volumes to save Jenkins data outside the container. This keeps your data safe even if the container is removed.
Click to reveal answer
What does the command docker pull jenkins/jenkins:lts do?
ARemoves the Jenkins Docker image
BStarts a Jenkins container
CDownloads the latest stable Jenkins Docker image
DUpdates Docker to the latest version
✗ Incorrect
The docker pull command downloads the specified image from Docker Hub.
Which port is used to access Jenkins web interface when running in Docker?
A8080
B80
C50000
D443
✗ Incorrect
Port 8080 is the default port for Jenkins web interface.
Why should you use Docker volumes with Jenkins containers?
ATo speed up Jenkins builds
BTo change Jenkins user interface
CTo increase container memory
DTo save Jenkins data outside the container
✗ Incorrect
Docker volumes keep data safe even if the container is deleted.
What does the -p 8080:8080 option do in docker run?
AMaps host port 8080 to container port 8080
BLimits container CPU usage
CSets container memory to 8080 MB
DRuns container in background
✗ Incorrect
It connects the host's port 8080 to the container's port 8080.
Which command starts Jenkins in Docker and maps ports for web and agent access?
Adocker run -p 8080:8080 jenkins/jenkins:lts
Bdocker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
Cdocker start jenkins
Ddocker build jenkins/jenkins:lts
✗ Incorrect
This command maps both web interface and agent ports.
Explain how to install and run Jenkins using Docker from scratch.
Think about the commands and port mapping needed.
You got /4 concepts.
Describe why Docker volumes are important when running Jenkins in Docker.
Consider what happens if the container is deleted.
You got /3 concepts.
Practice
(1/5)
1. What is the main advantage of installing Jenkins using Docker?
easy
A. It only works on Windows systems
B. It requires manual setup of all dependencies
C. It disables Jenkins security features
D. It makes Jenkins installation quick and clean
Solution
Step 1: Understand Docker's role in Jenkins installation
Docker packages Jenkins and its dependencies in a container, simplifying setup.
Step 2: Identify the benefit of containerization
This containerization makes installation fast and keeps the system clean without leftover files.
Final Answer:
It makes Jenkins installation quick and clean -> Option D
Quick Check:
Docker simplifies Jenkins install = A [OK]
Hint: Docker containers isolate Jenkins for easy setup [OK]
Common Mistakes:
Thinking Docker disables Jenkins security
Assuming Docker only works on Windows
Believing manual dependency setup is needed
2. Which Docker command correctly runs Jenkins with port 8080 mapped to the host?
easy
A. docker run -p 8080 jenkins/jenkins
B. docker run -p 80:8080 jenkins/jenkins
C. docker run -p 8080:8080 jenkins/jenkins
D. docker run --port 8080:8080 jenkins/jenkins
Solution
Step 1: Recall Docker port mapping syntax
The correct syntax is '-p hostPort:containerPort'.
Step 2: Match Jenkins default port
Jenkins listens on port 8080 inside the container, so map host 8080 to container 8080.
Final Answer:
docker run -p 8080:8080 jenkins/jenkins -> Option C
Quick Check:
Port mapping uses -p host:container = A [OK]
Hint: Use -p hostPort:containerPort for port mapping [OK]
Common Mistakes:
Using wrong port order in mapping
Omitting container port
Using --port instead of -p
3. What will be the effect of running this command?
docker run -d -p 8080:8080 -v jenkins_home:/var/jenkins_home jenkins/jenkins
medium
A. Starts Jenkins but data will be lost after container stops
B. Starts Jenkins in detached mode with data persisted in volume 'jenkins_home'