Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd new bare image tag #1282
Add new bare image tag #1282
Conversation
|
I'm not sure whether this would match the multi-stage restrictions on official images or not https://github.com/docker-library/faq#multi-stage-builds |
|
If you can get a |
@nschonni From what I understand of this sentence, it would be better to directly add the Node binaries to the image rather than building them. @tianon The problem is I don't know how the users rely on what part of the existing alpine image so removing some part of the image may be a breaking change |
|
Any updates on this PR ? |
Aschen commentedJun 26, 2020
•
edited
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.9MBwhich is 40% smaller than the14-alpine3.10image (117MB).If you like the idea I will adds images for other Node version.
EDIT (2020/07/03):
This image is now based on
alpineto benefits from the shell and package manager for only5MB.The image is
71MB.I've renamed the image tag from
scratchtobare.Usage
This image can be used in a multi-stage build:
alpineimage, build the applicationbareimage, 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
alpinewith only Node.js.