Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node.js "core" image #808

Closed
wants to merge 2 commits into from
Closed

Add Node.js "core" image #808

wants to merge 2 commits into from

Conversation

chorrell
Copy link
Contributor

@chorrell chorrell commented Jul 4, 2018

This is an image without npm or yarn installed, suitable for multi-stage
builds.

Also:

  • Skip setting yarn version in core variant
  • Skip npm and yarn tests for "core" variant

Closes #404

Things left to do:

  • Update README.md
  • PR/update for Docker hub docs?
  • Verify that npm is thoroughly uninstalled

@chorrell
Copy link
Contributor Author

chorrell commented Jul 4, 2018

I cancelled the branch build since the PR build should be good enough. In the future I'll do PRs from my fork.

@chorrell
Copy link
Contributor Author

chorrell commented Jul 4, 2018

Also note that I have not update the README.md yet to document this new variant.

PeterDaveHello

This comment was marked as off-topic.

SimenB

This comment was marked as off-topic.

SimenB

This comment was marked as off-topic.

@SimenB
Copy link
Member

SimenB commented Jul 5, 2018

Just curious about if the npm comes with nodejs release, do we need to remove it.

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!

@pesho
Copy link
Contributor

pesho commented Jul 5, 2018

@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 core version for Alpine would be most useful. To avoid building twice, maybe the alpine image could be built FROM alpine-core?

@LaurentGoderre
Copy link
Member

@pesho wouldn't that mean installing node, removing npm, then create another image to add back npm?

@pesho
Copy link
Contributor

pesho commented Jul 5, 2018

@LaurentGoderre exactly. Is there another viable alternative?

@LaurentGoderre
Copy link
Member

I think it would be cool to change the tags to have 8-alpine-dev to have npm and yarn and 8-alpine to not have either. That would be a huge change and would probably cause a lot of grief.

@chorrell
Copy link
Contributor Author

chorrell commented Jul 6, 2018

Building an alpine image without npm is easy enough I guess, but I'm generally 👎 about creating an alpine core image. I'd be more convinced if we had official MUSL/alpine binaries to use but until then I think we need to be honest with ourselves and our users about the level of support they can expect when it comes to Alpine.

@MylesBorins
Copy link
Contributor

There have been external requests for an alpine-core images... which could be made with the single change of ./configure --without-npm

/cc @mhart who manages https://github.com/mhart/alpine-node and may have opinions

@tianon
Copy link
Contributor

tianon commented Jul 31, 2018

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)

@MylesBorins
Copy link
Contributor

+1 to what @tianon just mentioned. I find the use of the term core here a bit confusing as "node core" is already something we use to describe... well node 😅.

Is there a reason to avoid using tiny?

@chorrell
Copy link
Contributor Author

chorrell commented Aug 1, 2018

I chose the name arbitrarily. I’m open to alternatives.

@mhart
Copy link

mhart commented Aug 1, 2018

Other alternatives: base, light, basic, simple

@mhart
Copy link

mhart commented Aug 1, 2018

Or even copy debian: slim 😸

@mhart
Copy link

mhart commented Aug 1, 2018

Also, I don't see any alpine images here – wouldn't they be the most... tiny?

@chorrell
Copy link
Contributor Author

chorrell commented Aug 1, 2018

Yes, but but I didn't include them for reasons noted in #808 (comment)

@bnb
Copy link

bnb commented Nov 12, 2018

Mostly just curious (not asking for more work!): What's the status of this PR?

@chorrell
Copy link
Contributor Author

No consensus on what it should be called I think.

@bnb
Copy link

bnb commented Nov 26, 2018

Anything I can do to help push toward getting consensus? 🤗

@SimenB
Copy link
Member

SimenB commented Nov 27, 2018

@bnb I personally don't care what the name is, seems like something the node core collaborators should decide on?

This is an image without npm or yarn installed, suitable for multi-stage
builds.

Also:

- Skip setting yarn version in core variant
- Skip npm and yarn tests for "core" variant

Closes #404
@caub
Copy link

caub commented Jan 10, 2019

I propose minimal / mini for the tag naming, and I hope this will land with whatever name asap

@jbergstroem
Copy link
Member

jbergstroem commented Jan 15, 2019

I would suggest we avoid words related to size as part of the name. What would happen the day we make it smaller than tiny or minimal (eg, stripping debug symbols)? A better approach would be expressing functionality (which core does better but has conflict as brought up by @MylesBorins). Would bare fit the bill?

Edit: also, I think core or bare or whatever it ends up being should rather be a per-distro option (in a way, similar to how slim works) or limited to for instance alpine where trade-offs for size and functionality have already been made.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! This is super nice.

@LaurentGoderre
Copy link
Member

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 -nopm (No Package manager) or -xpm (Excluding package managers) and have a version with that suffix for each variant.

@LaurentGoderre
Copy link
Member

We could also use the same image and add an ARG for nopm or xpm and run the removal of npm if it's true and not run the YARN install if it's false.

@caub
Copy link

caub commented Jan 22, 2019

mhart/alpine-node has a base tag for this https://github.com/mhart/alpine-node

@mhart
Copy link

mhart commented Jan 22, 2019

mhart/alpine-node have a base tag for this https://github.com/mhart/alpine-node

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

@chorrell
Copy link
Contributor Author

chorrell commented Aug 6, 2019

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"

@chorrell chorrell closed this Aug 6, 2019
@caub
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image without npm nor yarn