305-300 · Question #10
What is the purpose of a .dockerignore file?
The correct answer is B. It specifies files that Docker does not submit to the Docker daemon when building a Docker image. The purpose of a .dockerignore file is to specify files that Docker does not submit to the Docker daemon when building a Docker image. A .dockerignore file is a text file that contains a list of files or directories that should be excluded from the build context, which is the…
Question
Options
- AIt lists files existing in a Docker image which should be excluded when building a derivative image.
- BIt specifies files that Docker does not submit to the Docker daemon when building a Docker image
- CIt exists in the root file system of containers that should ignore volumes and ports provided by
- DIt must be placed in the top level directory of volumes that Docker should never attach
- EIt specifies which parts of a Dockerfile should be ignored when building a Docker image.
How the community answered
(47 responses)- A4% (2)
- B85% (40)
- C2% (1)
- E9% (4)
Explanation
The purpose of a .dockerignore file is to specify files that Docker does not submit to the Docker daemon when building a Docker image. A .dockerignore file is a text file that contains a list of files or directories that should be excluded from the build context, which is the set of files and folders that are available for use in a Dockerfile. By using a .dockerignore file, you can avoid sending files or directories that are large, contain sensitive information, or are irrelevant to the Docker image to the daemon, which can improve the efficiency and security of the build process.
Topics
Community Discussion
No community discussion yet for this question.