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 Node.js "core" image #808
Conversation
|
I cancelled the branch build since the PR build should be good enough. In the future I'll do PRs from my fork. |
|
Also note that I have not update the README.md yet to document this new variant. |
|
Just curious about if the npm comes with nodejs release, do we need to remove it. Otherwise, LGTM. Should squash these two commits before merging. |
| && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ | ||
| && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ | ||
| && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ | ||
| && rm -rf /usr/local/lib/node_modules/ \ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nschonni
Jul 6, 2018
Member
https://docs.npmjs.com/misc/removing-npm#more-severe-uninstalling might be a good base
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
chorrell
Jul 6, 2018
Author
Contributor
Hmm, that method doesn't seem to uninstall /usr/local/lib/node_modules/npm/
This comment has been minimized.
This comment has been minimized.
chorrell
Jul 6, 2018
Author
Contributor
Dropped that commit. The original approach seems to do the job.
I think it makes sense to remove both. Multi-stage builds really removes the need for them, and allows people to get really small images. @chorrell thoughts on having a core version for alpine as well? People pick alpine since it's tiny, making an even smaller version makes sense to me. Can of course be done in a follow-up! |
Indeed, a |
|
@pesho wouldn't that mean installing node, removing npm, then create another image to add back npm? |
|
@LaurentGoderre exactly. Is there another viable alternative? |
|
I think it would be cool to change the tags to have |
|
Building an alpine image without npm is easy enough I guess, but I'm generally |
|
There have been external requests for an alpine-core images... which could be made with the single change of /cc @mhart who manages https://github.com/mhart/alpine-node and may have opinions |
|
Just to make sure, is "Node.js core" something that has the intended meaning with upstream too? (ie, will Node.js users already be familiar with that as a term, or is this an entirely new construct? the discussion in nodejs/Release#341 seems to imply that this is still a little bit in flux, so it might make sense to make sure the larger Node.js project is on board with the "core" name before committing to it too much) |
|
+1 to what @tianon just mentioned. I find the use of the term Is there a reason to avoid using |
|
I chose the name arbitrarily. I’m open to alternatives. |
mhart
commented
Aug 1, 2018
|
Other alternatives: |
mhart
commented
Aug 1, 2018
|
Or even copy debian: |
mhart
commented
Aug 1, 2018
|
Also, I don't see any alpine images here – wouldn't they be the most... tiny? |
|
Yes, but but I didn't include them for reasons noted in #808 (comment) |
|
Mostly just curious (not asking for more work!): What's the status of this PR? |
|
No consensus on what it should be called I think. |
|
Anything I can do to help push toward getting consensus? |
|
@bnb I personally don't care what the name is, seems like something the node core collaborators should decide on? |
caub
commented
Jan 10, 2019
•
|
I propose |
|
I would suggest we avoid words related to size as part of the name. What would happen the day we make it smaller than Edit: also, I think |
|
Wow! This is super nice. |
|
I foresee some problem with the base image being use (the same way we had issue transitioning the default tag from jessie to stretch. I would be tempted to use a suffix like |
|
We could also use the same image and add an |
caub
commented
Jan 22, 2019
•
|
mhart/alpine-node has a |
mhart
commented
Jan 22, 2019
It's not quite the same thing – that's a static build which might not work with native modules. The third example here is basically what's being proposed here, I think: https://github.com/mhart/alpine-node#example-dockerfile-for-your-own-nodejs-project |
|
I won't be able to carry this forward. If someone else want's to take this on, "base" is probably a better name than "core" |
caub
commented
Aug 6, 2019
•
|
too bad here's a workaround: https://github.com/brigand/jellobot/blob/master/src/plugins/js-eval/Dockerfile#L8, but a node core image would have made things simpler for the final image |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

chorrell commentedJul 4, 2018
•
edited
This is an image without npm or yarn installed, suitable for multi-stage
builds.
Also:
Closes #404
Things left to do: