2
2
# # Builder ##
3
3
# ############
4
4
5
- FROM --platform=linux/amd64 rust:slim AS builder
5
+ FROM --platform=$BUILDPLATFORM rust:slim AS builder
6
6
7
7
ARG TARGETARCH
8
8
@@ -11,9 +11,9 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER="aarch64-linux-gnu-gcc"
11
11
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-lgcc"
12
12
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER="arm-linux-gnueabihf-ld"
13
13
14
- COPY ./containerised/platform .sh .
14
+ COPY ./containerised/target .sh .
15
15
16
- RUN chmod +x ./platform .sh && ./platform .sh
16
+ RUN chmod +x ./target .sh && ./target .sh
17
17
18
18
RUN apt-get update && apt-get install $(cat /.compiler) -y
19
19
@@ -29,10 +29,10 @@ COPY Cargo.* /usr/src/oxker/
29
29
WORKDIR /usr/src/oxker
30
30
31
31
# Install target platform (Cross-Compilation)
32
- RUN rustup target add $(cat /.platform )
32
+ RUN rustup target add $(cat /.target )
33
33
34
34
# This is a dummy build to get the dependencies cached - probably not needed - as run via a github action
35
- RUN cargo build --target $(cat /.platform ) --release
35
+ RUN cargo build --target $(cat /.target ) --release
36
36
37
37
# Now copy in the rest of the sources
38
38
COPY src /usr/src/oxker/src/
@@ -41,9 +41,9 @@ COPY src /usr/src/oxker/src/
41
41
RUN touch /usr/src/oxker/src/main.rs
42
42
43
43
# This is the actual application build
44
- RUN cargo build --release --target $(cat /.platform )
44
+ RUN cargo build --release --target $(cat /.target )
45
45
46
- RUN cp /usr/src/oxker/target/$(cat /.platform )/release/oxker /
46
+ RUN cp /usr/src/oxker/target/$(cat /.target )/release/oxker /
47
47
48
48
# ############
49
49
# # Runtime ##
0 commit comments