Bird
0
0

Given this snippet in a CI/CD pipeline YAML file:

medium📝 Command Output Q13 of 15
Docker - in CI/CD
Given this snippet in a CI/CD pipeline YAML file:
steps:
  - name: Build image
    run: docker build -t myapp:1.0 .
  - name: Push image
    run: docker push myapp:1.0
  - name: Deploy
    run: kubectl set image deployment/myapp myapp=myapp:1.0

What will happen after this pipeline runs successfully?
AThe Kubernetes deployment will update to use the new Docker image tagged 1.0
BThe Docker image will be deleted from the registry
CThe deployment will roll back to the previous image
DThe Docker image will only be built locally without pushing
Step-by-Step Solution
Solution:
  1. Step 1: Analyze build and push steps

    The pipeline builds the image tagged 'myapp:1.0' and pushes it to the registry.
  2. Step 2: Analyze deployment step

    The command updates the Kubernetes deployment to use the new image 'myapp:1.0'.
  3. Final Answer:

    The Kubernetes deployment will update to use the new Docker image tagged 1.0 -> Option A
  4. Quick Check:

    Build + push + deploy = update deployment [OK]
Quick Trick: Build, push, then deploy updates the app [OK]
Common Mistakes:
  • Assuming image is only local, not pushed
  • Thinking deployment rolls back automatically
  • Confusing deployment update with image deletion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes