File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
# FROM rust as build-stage
2
2
# ARG ARCH=x86_64
3
3
ARG TARGET_PLATFORM=linux/arm64
4
- FROM --platform=$TARGET_PLATFORM public.ecr.aws/awsguru/ rust-builder as build-stage
4
+ FROM --platform=$TARGET_PLATFORM rust:latest as build-stage
5
5
ARG ARCH=aarch64
6
6
WORKDIR /app
7
7
8
8
# Copy over manifest files
9
9
COPY ./extension/Cargo.toml ./Cargo.toml
10
10
COPY ./.cargo ./.cargo
11
11
12
- # RUN rustup target add aarch64-unknown-linux-musl
12
+ RUN rustup target add aarch64-unknown-linux-musl
13
+ RUN rustup target add x86_64-unknown-linux-musl
14
+
15
+ # Install MUSL cross-compilation tools
16
+ RUN apt-get update && \
17
+ apt-get install -y musl-tools
18
+
19
+ # RUN source $HOME/.cargo/env && cargo --version
13
20
14
21
# This dummy build is to get the dependencies cached
15
22
RUN mkdir src && \
16
23
echo 'fn main() {println!("if you see this, the build broke")}' > src/main.rs &&\
17
- source $HOME/.cargo/env &&\
18
24
export PATH=$PATH:/${ARCH}-linux-musl-cross/bin/ &&\
19
- CC=${ARCH}-unknown- linux-musl-gcc cargo build --release --target=${ARCH}-unknown-linux-musl
25
+ CC=${ARCH}-linux-musl-gcc cargo build --release --target=${ARCH}-unknown-linux-musl
20
26
21
27
ADD ./extension/ .
22
28
RUN touch src/main.rs &&\
23
- source $HOME/.cargo/env &&\
24
29
export PATH=$PATH:/${ARCH}-linux-musl-cross/bin/ &&\
25
- CC=${ARCH}-unknown- linux-musl-gcc cargo build --release --target=${ARCH}-unknown-linux-musl
30
+ CC=${ARCH}-linux-musl-gcc cargo build --release --target=${ARCH}-unknown-linux-musl
26
31
27
32
FROM scratch AS package-stage
28
33
# ARG ARCH=x86_64
You can’t perform that action at this time.
0 commit comments