File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ ADD config.toml /usr/local/cargo/
24
24
RUN cargo install --root /cargo-cross
[email protected] [email protected]
25
25
26
26
27
- FROM rust:${RUST_VERSION}-alpine3.20
27
+ FROM rust:${RUST_VERSION}-alpine3.20 AS tools-target
28
28
ENV TARGETS="x86_64-unknown-linux-musl aarch64-unknown-linux-musl x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu riscv64gc-unknown-linux-gnu"
29
29
RUN rustup target add ${TARGETS}
30
30
@@ -35,3 +35,18 @@ RUN apk add musl-dev linux-headers make clang mold
35
35
COPY --from=tools /cargo-cross /usr/local/cargo
36
36
# we define target specific rustc flags for cross-compilation
37
37
ADD config.toml /usr/local/cargo/
38
+
39
+ FROM tools-target AS tools-target-amd64
40
+ # RUN rustup default $RUST_VERSION-x86_64-unknown-linux-gnu
41
+ ENV CARGO_BUILD_TARGET="x86_64-unknown-linux-musl"
42
+
43
+ FROM tools-target AS tools-target-arm64
44
+ # RUN rustup default $RUST_VERSION-aarch64-unknown-linux-gnu
45
+ ENV CARGO_BUILD_TARGET="aarch64-unknown-linux-musl"
46
+
47
+ FROM tools-target AS tools-target-riscv64
48
+ RUN rustup default $RUST_VERSION-riscv64gc-unknown-linux-gnu
49
+ ENV CARGO_BUILD_TARGET="riscv64gc-unknown-linux-gnu"
50
+
51
+ FROM tools-target-$TARGETARCH AS tools-trget
52
+ RUN echo "Cargo target: $CARGO_BUILD_TARGET"
You can’t perform that action at this time.
0 commit comments