Building images, topic 19 of 41
The build context
The . at the end of docker build is the build context: the files the builder may read. COPY can only take files from it, and a large context, with node_modules, .git or build output, makes every build slower.
A .dockerignore file leaves files out of the context, as .gitignore does for Git. It also keeps secrets such as .env files out of an image by accident.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.