On Tuesday, 5 November 2019 at 12:20:04 UTC, Jacob Carlborg wrote:
On Tuesday, 5 November 2019 at 11:49:20 UTC, Daniel Kozak wrote:
Generally no, because Apline use musl libc instead of glibc,
so there are some issues with that
The correct way is to use static linking and putting only the
binary in a Docker image, i.e. "from scratch" [1] ;). But using
Alpine and musl will help with building the binary.
[1] https://hub.docker.com/_/scratch
And the neat way to do that is with a multi-stage build: one
Dockerfile, with an Alpine container building the binary, then
copying to a FROM scratch container:
https://docs.docker.com/develop/develop-images/multistage-build/
The musl build is practically necessary because glibc has
effectively given up standalone static binary support. So,
thanks BPF Korea :)