Dockerfile MCQs with answers
67 questions tagged Dockerfile, each with the correct answer and an explanation. Page 1 of 4.
- Which instruction should be placed at the beginning of a Dockerfile?
- Can a Dockerfile contain comments?
- What should you do to reduce image size?
- Which instruction is used to configure the container at runtime?
- What is the default shell used by `RUN` in a Dockerfile?
- What flag skips the cache when building a Docker image?
- What does each line in a Dockerfile represent?
- What command builds an image using a Dockerfile?
- Which instruction in Dockerfile is deprecated?
- Which instruction can download files from a remote URL?
- What is the extension of a Dockerfile?
- Where should the Dockerfile be placed?
- What is the effect of using `ENTRYPOINT` with `CMD`?
- What is multi-stage build in Dockerfile?
- Which instruction sets the user to execute subsequent commands?
- How do you specify a maintainer for a Docker image?
- What is the best practice when copying large files in a Dockerfile?
- What happens if multiple `CMD` instructions are in a Dockerfile?
- Which instruction allows downloading and extracting tar files automatically?
- How can you copy files with permissions preserved?