0
0
Dockerdevops~10 mins

Deploying from CI/CD pipeline in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to build a Docker image in a CI/CD pipeline.

Docker
docker build -t myapp:latest [1] .
Drag options to blanks, or click blank then click option'
A-f Dockerfile
B--rm
C--push
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d which is for detached mode in run, not build.
Using --push which is for pushing images, not building.
Using --rm which is default behavior and not needed here.
2fill in blank
medium

Complete the code to push the Docker image to a registry in the CI/CD pipeline.

Docker
docker [1] myapp:latest
Drag options to blanks, or click blank then click option'
Apush
Bpull
Crun
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using pull which downloads images instead of uploading.
Using run which starts containers, not pushing images.
Using build which creates images, not pushes.
3fill in blank
hard

Fix the error in the command to run a container in detached mode in the CI/CD pipeline.

Docker
docker run [1] myapp:latest
Drag options to blanks, or click blank then click option'
A-it
B-p
C-d
D--rm
Attempts:
3 left
💡 Hint
Common Mistakes
Using -it which is for interactive mode.
Using --rm which removes container after exit, not detaching.
Using -p which is for port mapping, not detaching.
4fill in blank
hard

Fill both blanks to tag and push the Docker image to a remote registry in the CI/CD pipeline.

Docker
docker tag myapp:latest [1] && docker [2] [1]
Drag options to blanks, or click blank then click option'
Aregistry.example.com/myapp:latest
Bpush
Cpull
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using pull instead of push for uploading.
Using run which starts containers, not pushing images.
5fill in blank
hard

Fill all three blanks to build, tag, and push a Docker image in a CI/CD pipeline.

Docker
docker build -t [1] . && docker tag [1] [2] && docker [3] [2]
Drag options to blanks, or click blank then click option'
Amyapp:latest
Bregistry.example.com/myapp:latest
Cpush
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using run instead of push for uploading.
Mixing up local and remote tags.