AWS DevOps Engineer Professional DOP-C01 – Question476

You are building a Docker image with the following Dockerfile. How many layers will the resulting image have?
FROM scratch
CMD /app/hello.sh

A.
2
B. 4
C. 1
D. 3

Correct Answer: D

Explanation:

Explanation:
FROM scratch
CMD /app/hello.sh
The image contains all the layers from the base image (only one in this case, since we’re building rom scratch), plus a new layer with the CMD instruction, and a read-write container layer.
Reference: https://docs.docker.com/engine/userguide/storagedriver/imagesandcon…