-
Notifications
You must be signed in to change notification settings - Fork 390
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
add docker/buildx compatible tags #1379
Comments
I'm not sure I understand this feature request, I understand the spirit, but not how it would be used. Could you explain a bit further how this would be done and used? I'll also explain abit, today it's possible to do
#1104 exists to track how we would generate multiarch images with the cross-compiled binary inside. side note, I don't think |
I should clearyfi this more. FROM --platform=$BUILDPLATFORM ghcr.io/rust-cross/rust-musl-cross:aarch64-unknown-linux-musl AS builder
SHELL ["/bin/bash", "-uo", "pipefail", "-c"]
ARG version
RUN apt-get -y update && apt-get -y install protobuf-compiler musl musl-dev musl-tools
ENV PROTOC=/usr/bin/protoc
RUN echo "build version ${version}"
RUN cargo install --locked --git https://github.com/ankitects/anki.git --tag ${version} anki-sync-server
RUN ldd /usr/local/cargo/bin/anki-sync-server
FROM --platform=$BUILDPLATFORM scratch
ENV SYNC_BASE=/data
COPY --from=builder --chmod=0755 /usr/local/cargo/bin/anki-sync-server /
CMD ["./anki-sync-server"] So I do not use the cross binary, which mean I can not use the meta data section of the cargo.toml.
The problem is that My suggestion is to add additional |
aha! I think then that you're on the wrong issue tracker, this is you probably want to raise this on https://github.com/rust-cross/rust-musl-cross instead! :D |
Ups sorry for this. Issue moved to rust-cross/rust-musl-cross#133 |
Checklist
Describe your request
Since buildx exist out of docker image it would ideal to be used in the Docker
From
step inside a builder, to build mutliplatform images.For this you must choose an different image tag for each platform. Docker/Buildx allows you to use environments variables like
TARGETPLATFORM
inside the from step. The problem is that docker does not allow to use function here. So there is no way to mapTARGETPLATFORM
to the needed rust tool chain.Adding additional tags like
musl-linux/arm64
,musl-linux/arm/v7
", etc would allow to use it as builder:Describe why this would be a good inclusion for
cross
It allows to use cross to build multiplatforms docker images without using DiD.
Hit this issue at ankitects/anki#2798, so currently only linux/amd64 is supported.
Maybe an solution for #1104
The text was updated successfully, but these errors were encountered: