Bird
0
0

Which of the following is the correct way to specify the scratch base image in a Dockerfile?

easy📝 Syntax Q12 of 15
Docker - Image Optimization
Which of the following is the correct way to specify the scratch base image in a Dockerfile?
AFROM base scratch
BFROM scratch
CFROM minimal/scratch
DFROM scratch:latest
Step-by-Step Solution
Solution:
  1. Step 1: Recall Dockerfile syntax for base images

    The correct syntax is FROM <image-name> without extra words.
  2. Step 2: Check official usage of scratch

    scratch is a special empty image and is referenced simply as FROM scratch.
  3. Final Answer:

    FROM scratch -> Option B
  4. Quick Check:

    Base image syntax = FROM scratch [OK]
Quick Trick: Use exactly 'FROM scratch' in Dockerfile [OK]
Common Mistakes:
  • Adding tags like :latest to scratch
  • Using extra words like 'base' or 'minimal/'
  • Incorrect syntax like FROM scratch:latest

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes