0
0
Dockerdevops~20 mins

Deploying from CI/CD pipeline in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CI/CD Docker Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of Docker command in CI/CD
You run this command in your CI pipeline to build and tag a Docker image:

docker build -t myapp:latest .

What will be the output if the Dockerfile is missing in the current directory?
Docker
docker build -t myapp:latest .
ASuccessfully built and tagged myapp:latest
BBuild completed but image not tagged
CWarning: No Dockerfile specified, using default
DError response from daemon: Dockerfile not found
Attempts:
2 left
💡 Hint
Think about what Docker needs to build an image.
🔀 Workflow
intermediate
2:00remaining
Correct order of CI/CD deployment steps
Arrange these steps in the correct order for deploying a Dockerized app from a CI/CD pipeline:
A3,2,1,4
B2,3,1,4
C3,1,2,4
D1,3,2,4
Attempts:
2 left
💡 Hint
Think about building before testing and pushing.
Troubleshoot
advanced
2:00remaining
Troubleshooting failed Docker push in CI
In your CI pipeline, the Docker push command fails with:

denied: requested access to the resource is denied

What is the most likely cause?
Docker
docker push myregistry.com/myapp:latest
AYou are not logged in to the Docker registry
BThe Dockerfile has syntax errors
CThe image was not built before push
DThe Docker daemon is not running
Attempts:
2 left
💡 Hint
Think about permissions and authentication.
🧠 Conceptual
advanced
2:00remaining
Why use multi-stage builds in CI/CD pipelines?
What is the main benefit of using multi-stage Docker builds in a CI/CD pipeline?
AIt automatically deploys the image after build
BIt allows running multiple containers simultaneously
CIt reduces the final image size by separating build and runtime stages
DIt speeds up the Docker daemon startup time
Attempts:
2 left
💡 Hint
Think about image size and efficiency.
Best Practice
expert
2:00remaining
Secure handling of secrets in CI/CD Docker deployments
Which method is the safest way to handle sensitive environment variables (like passwords) during Docker image deployment in a CI/CD pipeline?
APass secrets as plain text arguments during docker build
BStore secrets in the CI/CD platform's secret manager and inject at runtime
CInclude secrets in the source code repository in a .env file
DHardcode secrets in the Dockerfile using ENV instructions
Attempts:
2 left
💡 Hint
Think about avoiding exposure of secrets in images or code.