File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 1- FROM rust:latest AS build
1+ FROM --platform=$BUILDPLATFORM rust:latest AS build
2+
3+ ARG TARGETPLATFORM
4+ ARG TARGETARCH
25
36WORKDIR /app
47
58RUN \
69 DEBIAN_FRONTEND=noninteractive \
7- apt-get update &&\
8- apt-get -y install ca-certificates tzdata
10+ apt-get update && \
11+ apt-get -y install ca-certificates tzdata && \
12+ if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then apt install -y g++-aarch64-linux-gnu; fi;
13+
14+ ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
915
1016COPY . .
1117
12- RUN \
13- CARGO_NET_GIT_FETCH_WITH_CLI=true \
14- cargo build --release
18+ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
19+ rustup target add aarch64-unknown-linux-gnu && \
20+ cargo build --target aarch64-unknown-linux-gnu --release; \
21+ else \
22+ cargo build --release; \
23+ fi
1524
1625# https://hub.docker.com/r/bitnami/minideb
1726FROM bitnami/minideb:latest AS final
You can’t perform that action at this time.
0 commit comments