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

Use alpine image to reduce docker image size #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Kyle2142
Copy link

I haven't tested further, but at the very least the alpine version starts up after docker build on my raspberry pi (armhf)

Copy link

@jujaga jujaga left a comment

Choose a reason for hiding this comment

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

I'd propose using node:lts-alpine image instead as it would stay on a more production-grade LTS release as a base image instead, while achieving image size reduction that you've proposed.

@Kyle2142
Copy link
Author

Kyle2142 commented Nov 27, 2020 via email

@Kyle2142
Copy link
Author

Please don't merge just yet, I'm testing multi stage building to reduce size further

@Kyle2142
Copy link
Author

Feel free to test and (squash) merge if you're happy.
Building using master gives a resulting image of 940MB+, after last commit the image is 170MB

@Kyle2142
Copy link
Author

I checked dockerhub, your image is somehow 340MB yet your dockerfile says FROM node:14 which is definitely 774MB.
Attached is building with master and my PR, respectively image
That's pretty weird. Did you use a slim image or something but forgot to commit that?

@vrnagy
Copy link
Contributor

vrnagy commented Dec 4, 2020

@Kyle2142 on Docker HUB You see compressed image size, but on localhost You see uncompressed size, that's the difference

@ubergeek77
Copy link

I'm on board with using Alpine, but I just wanted to point out that using musl-libc (as used in Alpine) instead of glibc (used literally everywhere else) often comes with either a stability or performance impact.

99% of the time, it's fine, but at least as far as the public server goes, I don't really recommend this as it needs all the power it can get.

As for everyone else, it likely won't matter.

There is a version of Alpine that uses glibc though, which does defeat about half the reason of using Alpine, but does produce an image that is substantially smaller while being able to use glibc.

@Kyle2142
Copy link
Author

Kyle2142 commented Dec 9, 2020

Are we waiting for glibc changes or is there some other reason this PR is turning stale?

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.

4 participants