mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 12:35:28 +00:00
replaced hard-coded architecture with buildx target
This commit is contained in:
parent
2787c9ce4b
commit
caed20cc4d
1 changed files with 9 additions and 1 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -6,7 +6,15 @@ RUN apk --no-cache add libc-dev
|
||||||
COPY src src
|
COPY src src
|
||||||
COPY Cargo.toml .
|
COPY Cargo.toml .
|
||||||
COPY Cargo.lock .
|
COPY Cargo.lock .
|
||||||
RUN cargo install --target x86_64-unknown-linux-musl --path .
|
ARG TARGETARCH
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
|
cargo install --target x86_64-unknown-linux-musl --path . ; \
|
||||||
|
elif [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
|
cargo install --target aarch64-unknown-linux-musl --path . ; \
|
||||||
|
else \
|
||||||
|
echo "The architecture $TARGETARCH isn't unsupported." && exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
FROM docker.io/library/alpine:latest
|
FROM docker.io/library/alpine:latest
|
||||||
COPY --from=builder /usr/local/cargo/bin/agate /usr/bin/agate
|
COPY --from=builder /usr/local/cargo/bin/agate /usr/bin/agate
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue