Bird
0
0

Given this CI pipeline snippet:

medium📝 Command Output Q4 of 15
Docker - in CI/CD
Given this CI pipeline snippet:
docker build -t myapp:latest .
docker push myapp:latest

What will happen after running these commands?
ABuilds the image locally and uploads it to the remote registry
BDeletes the local image and uploads nothing
CRuns the container named myapp:latest
DBuilds the image but does not upload it anywhere
Step-by-Step Solution
Solution:
  1. Step 1: Analyze docker build command

    Builds a Docker image named myapp:latest from the current directory.
  2. Step 2: Analyze docker push command

    Uploads the built image to the configured remote Docker registry.
  3. Final Answer:

    Builds the image locally and uploads it to the remote registry -> Option A
  4. Quick Check:

    Build + push = local build then upload [OK]
Quick Trick: docker push uploads images to remote registry [OK]
Common Mistakes:
  • Confusing push with run
  • Assuming push deletes local images
  • Thinking build alone uploads images

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes