Bird
0
0

Which of the following is the correct first line in a Dockerfile for a Flask app using Python 3.12?

easy📝 Syntax Q12 of 15
Flask - Deployment
Which of the following is the correct first line in a Dockerfile for a Flask app using Python 3.12?
AEXPOSE 5000
BRUN python3.12 install flask
CCOPY app.py /app
DFROM python:3.12-slim
Step-by-Step Solution
Solution:
  1. Step 1: Identify Dockerfile base image syntax

    The Dockerfile must start with a FROM statement specifying the base image.
  2. Step 2: Choose correct Python version image

    "FROM python:3.12-slim" correctly sets Python 3.12 as base.
  3. Final Answer:

    FROM python:3.12-slim -> Option D
  4. Quick Check:

    Dockerfile starts with FROM base image = D [OK]
Quick Trick: Dockerfile always starts with FROM base image line [OK]
Common Mistakes:
MISTAKES
  • Using RUN before FROM
  • Copying files before setting base image
  • Exposing ports before base image

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes