0
0
Jenkinsdevops~10 mins

Pushing images to registry 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 log in to a Docker registry using Jenkins pipeline.

Jenkins
sh 'docker [1] myregistry.example.com -u user -p password'
Drag options to blanks, or click blank then click option'
Apull
Bpush
Clogin
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker push' instead of 'docker login' for authentication.
Using 'docker build' which is for building images, not logging in.
2fill in blank
medium

Complete the code to tag a Docker image before pushing it to the registry.

Jenkins
sh 'docker tag myapp:latest [1]/myapp:latest'
Drag options to blanks, or click blank then click option'
Amyregistry.example.com
Blatest
Cmyapp
Ddocker.io
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'latest' alone without registry URL.
Using 'docker.io' when the target registry is different.
3fill in blank
hard

Fix the error in the Jenkins pipeline step to push the Docker image to the registry.

Jenkins
sh 'docker [1] myregistry.example.com/myapp:latest'
Drag options to blanks, or click blank then click option'
Abuild
Blogin
Crun
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'docker build' which only builds images locally.
Using 'docker login' which is for authentication, not pushing.
4fill in blank
hard

Fill both blanks to build and push a Docker image in Jenkins pipeline.

Jenkins
sh 'docker [1] -t myregistry.example.com/myapp:latest . && docker [2] myregistry.example.com/myapp:latest'
Drag options to blanks, or click blank then click option'
Abuild
Bpush
Clogin
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of build and push commands.
Using 'docker run' instead of 'docker push' to upload.
5fill in blank
hard

Fill all three blanks to log in, build, and push a Docker image in Jenkins pipeline.

Jenkins
sh 'docker [1] myregistry.example.com -u user -p password && docker [2] -t myregistry.example.com/myapp:latest . && docker [3] myregistry.example.com/myapp:latest'
Drag options to blanks, or click blank then click option'
Alogin
Bbuild
Cpush
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Skipping login before pushing.
Using 'docker run' instead of 'docker push'.