Bird
0
0

Which command is used to build a Docker image from a Dockerfile for a Flask app?

easy📝 Conceptual Q2 of 15
Flask - Deployment
Which command is used to build a Docker image from a Dockerfile for a Flask app?
Adocker run -t flask-app
Bdocker build -t flask-app .
Cdocker start flask-app
Ddocker create flask-app
Step-by-Step Solution
Solution:
  1. Step 1: Identify the Docker command to build images

    The docker build command creates an image from a Dockerfile, using the current directory . as context.
  2. Step 2: Understand other Docker commands

    docker run starts a container, docker start restarts a stopped container, and docker create creates a container but does not build an image.
  3. Final Answer:

    docker build -t flask-app . -> Option B
  4. Quick Check:

    Build image = docker build [OK]
Quick Trick: Use 'docker build' to create images from Dockerfiles [OK]
Common Mistakes:
MISTAKES
  • Using 'docker run' instead of 'docker build' to create images
  • Confusing 'docker start' with building images
  • Forgetting the build context '.' at the end

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes