Skip to content

Use alpine build image for easier platform support#19

Open
riconnon wants to merge 1 commit intogbip:mainfrom
riconnon:alpine-build
Open

Use alpine build image for easier platform support#19
riconnon wants to merge 1 commit intogbip:mainfrom
riconnon:alpine-build

Conversation

@riconnon
Copy link

@riconnon riconnon commented Feb 8, 2024

This is a bit of a speculative PR that relates to, but doesn't completely solve, #18
I spent a bit of time producing my own multi-architecture images for this project and ended up using this Dockerfile in place of the original one. Wondered if you'd consider accepting it upstream since it's also a fair bit simpler/smaller than the existing one.

The existing docker image cannot easily be built for multi-arch using docker buildx or similar since it encodes the Rust target architecture using the ARCH build-arg. docker buildx provides the target architecture using the TARGETARCH build-arg but uses amd64 and arm64 compared to Rust using x86_64 and aarch64. To make this easier I've changed the builder image to the Alpine based version so that --target is not required to produce a static musl-based binary (since it's the default on Alpine).

The existing docker image cannot easily be built for multi-arch using
`docker buildx` or similar since it encodes the Rust target architecture
using the `ARCH` build-arg. `docker buildx` provides the target
architecture using the `TARGETARCH` build-arg but uses `amd64` and
`arm64` compared to Rust using `x86_64` and `aarch64`.
To make this easier I've changed the builder image to the Alpine based
version so that `--target` is not required to produce a static
musl-based binary (since it's the default on Alpine).
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.

1 participant