Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do
This PR introduce a new image tag (name proposals:
node:14-scratch
,node:14-minimal
,node:14-bare
) which correspond to a minimal image containing only Node binary and it's dependencies (mostly thelibstdc++
and musl).The image size is
68.9MB
which is 40% smaller than the14-alpine3.10
image (117MB
).If you like the idea I will adds images for other Node version.
EDIT (2020/07/03):
This image is now based on
alpine
to benefits from the shell and package manager for only5MB
.The image is
71MB
.I've renamed the image tag from
scratch
tobare
.Usage
This image can be used in a multi-stage build:
alpine
image, build the applicationbare
image, just copy the filesWhy
When you go to production, you may want to deploy images containing only your application and not your build chain (npm, yarn).
Also there is a lot of unnecessary files like documentation or c headers that you don't need either.
This could allows to save a lot of disk space but also bandwidth for people deploying Node.js applications.
How
Builder image steps description:
Then in the final image is built from
alpine
with only Node.js.