CrewLink-server icon indicating copy to clipboard operation
CrewLink-server copied to clipboard

Use alpine image to reduce docker image size

Open Kyle2142 opened this issue 5 years ago • 7 comments

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

Kyle2142 avatar Nov 22 '20 09:11 Kyle2142

Completely fair. I haven't had any problems with using the major tag so I never looked into others (like lts)

Kyle2142 avatar Nov 27 '20 23:11 Kyle2142

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

Kyle2142 avatar Nov 27 '20 23:11 Kyle2142

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 avatar Nov 28 '20 00:11 Kyle2142

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?

Kyle2142 avatar Nov 29 '20 22:11 Kyle2142

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

vrnagy avatar Dec 04 '20 16:12 vrnagy

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.

ubergeek77 avatar Dec 04 '20 21:12 ubergeek77

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

Kyle2142 avatar Dec 09 '20 15:12 Kyle2142