The space savings are less significant than expected, and
the detachment from official image layers actually makes
incremental updates longer.
Plus, arguably the image is much more extensible with
package managers.
Compiled assets and JavaScript files can run on any platform. So
always use host platform for build to eliminate emulation overhead.
Note that BUILDPLATFORM is new and requires docker buildx. It falls
back to amd64.
Do not run "git clean" for "pack" as node image does not
have git and it is arguably more dangerous to copy .git
folder into intermediate build image.
As we don't run "git clean", sensitive information might
be included in result package. Add a warning for that.
Secret is not used in build time. However, config.js
requires one. It won't affect runtime secret in any way
and "flood" used here will be blocked in runtime.
* Docker image has been greatly slimmed down and caches node_modules for rebuilds
* Update Dockerfile
* Dockerfile improvements
* Remove devDependencies from final image (#2)
* Remove devDependencies from final image
* Move to single-stage build
This does two things:
1. No longer user onbuild. Onbuild is deprecated for [reasons outlined
here][reasons].
2. Build static assets with the container. Before, the static assets
wouldn't be built causing the container to crash on start up.
[reasons]: https://github.com/docker-library/official-images/issues/2076