Bird
0
0

Given this Dockerfile snippet:

medium📝 Command Output Q13 of 15
Docker - Image Optimization
Given this Dockerfile snippet:
FROM python:3.12-slim
RUN pip install flask
COPY . /app
RUN rm -rf /tmp/*

What is the main benefit of using the python:3.12-slim base image here?
AIt is a smaller image, reducing build time and size
BIt disables network access for security
CIt automatically optimizes Python code
DIt includes all development tools by default
Step-by-Step Solution
Solution:
  1. Step 1: Understand base image types

    "slim" images are stripped down versions with fewer packages.
  2. Step 2: Identify benefits of slim images

    Smaller base images reduce overall image size and speed up builds.
  3. Final Answer:

    It is a smaller image, reducing build time and size -> Option A
  4. Quick Check:

    Using slim base = smaller image [OK]
Quick Trick: Slim base images reduce size and speed builds [OK]
Common Mistakes:
  • Assuming slim includes all tools
  • Thinking slim optimizes code automatically
  • Confusing security features with image size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes