Bird
0
0

Which of the following is the correct syntax to build a Docker image named app with tag v1 from the current directory?

easy📝 Syntax Q3 of 15
Docker - in CI/CD
Which of the following is the correct syntax to build a Docker image named app with tag v1 from the current directory?
Adocker create -t app:v1 .
Bdocker run -t app:v1 .
Cdocker build -t app:v1 .
Ddocker push -t app:v1 .
Step-by-Step Solution
Solution:
  1. Step 1: Understand Docker build command

    docker build creates an image from a Dockerfile in the specified directory.
  2. Step 2: Check correct flags and syntax

    -t sets the image name and tag; '.' means current directory.
  3. Final Answer:

    docker build -t app:v1 . -> Option C
  4. Quick Check:

    Build syntax = docker build -t name:tag . [OK]
Quick Trick: Use 'docker build -t name:tag .' to build images [OK]
Common Mistakes:
  • Using docker create or run instead of build
  • Misplacing the -t flag
  • Forgetting the build context '.'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes