Recall & Review
beginner
What is a Docker agent in Jenkins?
A Docker agent in Jenkins is a container that runs a Jenkins build or job isolated from the main Jenkins server. It provides a clean environment for each build.
Click to reveal answer
beginner
Why use Docker agents for isolation in Jenkins?
Docker agents isolate builds so they don't affect each other or the main server. This helps avoid conflicts and keeps builds clean and repeatable.
Click to reveal answer
intermediate
How do you specify a Docker agent in a Jenkins pipeline?
You specify a Docker agent in the pipeline using the 'agent' block with 'docker' and the image name, for example: agent { docker { image 'python:3.12' } }
Click to reveal answer
beginner
What happens to the Docker container after the Jenkins job finishes?
The Docker container used as an agent is stopped and removed automatically, ensuring no leftover state affects future builds.
Click to reveal answer
intermediate
Can Docker agents use custom Docker images?
Yes, you can use any Docker image as an agent, including custom images with pre-installed tools needed for your build.
Click to reveal answer
What is the main benefit of using Docker agents in Jenkins?
✗ Incorrect
Docker agents isolate builds so they run in clean environments, preventing conflicts.
How do you define a Docker agent in a Jenkins pipeline?
✗ Incorrect
The correct syntax uses the 'agent' block with 'docker' and 'image' keys.
What happens to the Docker container after the Jenkins job completes?
✗ Incorrect
Docker containers used as agents are stopped and removed to keep the environment clean.
Can you use a custom Docker image as a Jenkins agent?
✗ Incorrect
Jenkins supports any Docker image as an agent, including custom ones.
Which of these is NOT a reason to use Docker agents in Jenkins?
✗ Incorrect
Skipping tests is unrelated to Docker agents; agents focus on isolation and environment consistency.
Explain how Docker agents help maintain clean build environments in Jenkins.
Think about how a new room is cleaned before a new guest arrives.
You got /4 concepts.
Describe the steps to configure a Docker agent in a Jenkins pipeline.
Focus on the pipeline syntax for Docker agents.
You got /4 concepts.