Bird
0
0

Which of the following is a valid FROM line to use a distroless image for a Go application?

easy📝 Syntax Q3 of 15
Docker - Image Optimization
Which of the following is a valid FROM line to use a distroless image for a Go application?
AFROM gcr.io/distroless/static
BFROM gcr.io/distroless/python
CFROM gcr.io/distroless/java
DFROM gcr.io/distroless/base
Step-by-Step Solution
Solution:
  1. Step 1: Identify distroless images for Go apps

    For Go apps, the 'static' distroless image is commonly used because Go binaries are statically linked.
  2. Step 2: Match options to Go distroless images

    FROM gcr.io/distroless/static is 'static', suitable for Go apps; others are for base, Java, or Python.
  3. Final Answer:

    FROM gcr.io/distroless/static -> Option A
  4. Quick Check:

    Go distroless image = static [OK]
Quick Trick: Use 'static' for Go distroless images [OK]
Common Mistakes:
  • Using base image which lacks Go runtime
  • Choosing Java or Python distroless images for Go
  • Confusing static with base

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes