Bird
0
0

Which of the following is the correct Docker command to build an image named 'myapp' in a CI/CD pipeline step?

easy📝 Syntax Q3 of 15
Docker - in CI/CD
Which of the following is the correct Docker command to build an image named 'myapp' in a CI/CD pipeline step?
Adocker run -t myapp .
Bdocker create -t myapp .
Cdocker push myapp .
Ddocker build -t myapp .
Step-by-Step Solution
Solution:
  1. Step 1: Understand Docker build command

    To build an image, use 'docker build' with '-t' to tag the image name.
  2. Step 2: Check command correctness

    docker build -t myapp . uses 'docker build -t myapp .' which is correct syntax to build and tag image 'myapp'.
  3. Final Answer:

    docker build -t myapp . -> Option D
  4. Quick Check:

    Build image command = docker build -t [OK]
Quick Trick: Use 'docker build -t imagename .' to build images [OK]
Common Mistakes:
  • Using 'docker run' instead of 'docker build'
  • Trying to push before building
  • Using 'docker create' which creates containers, not images

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes