Skip to content

How to use with Alpine and Docker? #1270

Answered by mceachen
seepine asked this question in Q&A
Discussion options

You must be logged in to vote

@seepine if you want to keep your docker image small, use a multi-stage build: https://docs.docker.com/build/building/multi-stage/

The first stage should install python and a compiler tool chain, and then run npm install.

The second stage starts with the original small alpine image, and just copies over the compiled files.

If this is too in-the-weeds for you, I suspect using Alpine (with non-glibc, MUSL binaries) will be a lot more hassle than just this issue. I'd try to get running with a Debian slim image instead (the image will be slightly larger, but everything should “just work” out of the box).

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@seepine
Comment options

Comment options

You must be logged in to vote
2 replies
@seepine
Comment options

@mceachen
Comment options

Answer selected by mceachen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants