It lists files existing in a Docker image which should be excluded when building a derivative image.
B.
It specifies files that Docker does not submit to the Docker daemon when building a Docker image
C.
It exists in the root file system of containers that should ignore volumes and ports provided by Docker.
D.
It must be placed in the top level directory of volumes that Docker should never attach automatically to a container
E.
It specifies which parts of a Dockerfile should be ignored when building a Docker image.
The Answer Is:
B
This question includes an explanation.
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. The other options are incorrect because they do not describe the function of a .dockerignore file. Option A is wrong because a .dockerignore file does not affect the files existing in a Docker image, but only the files sent to the daemon during the build. Option C is wrong because a .dockerignore file does not exist in the root file system of containers, but in the same directory as the Dockerfile. Option D is wrong because a .dockerignore file does not affect the volumes that Docker attaches to a container, but only the files included in the build context. Option E is wrong because a .dockerignore file does not affect the parts of a Dockerfile that are executed, but only the files available for use in a Dockerfile. References:
What are .dockerignore files, and why you should use them?
Dockerfile reference | Docker Docs
How to use .dockerignore and its importance - Shisho Cloud
305-300 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"