Docker and CI/CD · Junior · Question 17 of 75
What is .dockerignore for?
- 1Listing containers that Docker should not start on boot
- ✓Correct answer: Excluding files from the build context sent to the builder
- 3Hiding environment variables from
docker inspectoutput
Explanation
Without it, node_modules, .git and .env are sent to the builder, which slows builds, busts the cache and may leak secrets into images via COPY . ..