0
0
Jenkinsdevops~5 mins

Docker image as artifact in Jenkins - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Docker image in the context of Jenkins pipelines?
A Docker image is a packaged snapshot of an application and its environment. In Jenkins pipelines, it acts as an artifact that can be built, stored, and reused to deploy consistent application versions.
Click to reveal answer
beginner
Why store Docker images as artifacts in Jenkins?
Storing Docker images as artifacts ensures that the exact application version is saved and can be deployed or tested later. It helps maintain consistency and traceability in the software delivery process.
Click to reveal answer
intermediate
Which Jenkins plugin is commonly used to push Docker images to a registry?
The 'Docker Pipeline' plugin is commonly used in Jenkins to build, tag, and push Docker images to registries like Docker Hub or private registries.
Click to reveal answer
beginner
What is the typical Jenkins pipeline step to build a Docker image?
The typical step is: docker.build('image-name:tag'). This command builds the Docker image from the Dockerfile in the workspace.
Click to reveal answer
intermediate
How can you ensure a Docker image artifact is reused in later Jenkins pipeline stages?
You can tag the Docker image with a unique version or build number and push it to a Docker registry. Later stages pull the image by this tag to reuse the exact artifact.
Click to reveal answer
What command in Jenkins pipeline builds a Docker image?
Adocker.build('my-image:latest')
Bdocker.push('my-image:latest')
Cdocker.pull('my-image:latest')
Ddocker.run('my-image:latest')
Why push a Docker image to a registry in Jenkins?
ATo run the image on Jenkins server
BTo store the image as an artifact for reuse
CTo delete the image from local storage
DTo convert the image to a container
Which plugin helps Jenkins interact with Docker images?
ADocker Pipeline plugin
BGit plugin
CMaven plugin
DSlack plugin
What is an artifact in Jenkins?
AA Jenkins user account
BA Jenkins plugin
CA build failure report
DA file or image saved after a build for later use
How do you tag a Docker image in Jenkins pipeline?
Adocker.push('my-image')
Bdocker.tag('my-image')
Cdocker.build('my-image:1.0')
Ddocker.run('my-image')
Explain how Docker images are used as artifacts in Jenkins pipelines.
Think about build, tag, push, and reuse steps.
You got /4 concepts.
    Describe the benefits of storing Docker images as artifacts in a CI/CD pipeline.
    Consider reliability and repeatability in software delivery.
    You got /4 concepts.