-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
35 lines (25 loc) · 1.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM rust:1.77.0-alpine
RUN apk add --no-cache ca-certificates build-base
# Install C compiler for cross-compilation. This is required by
# Wasmer in https://github.com/wasmerio/wasmer/blob/2.2.1/lib/vm/build.rs.
# For newer versions this might not be needed anymore since build.rs is removed
# in https://github.com/wasmerio/wasmer/pull/2807.
#
# https://unix.stackexchange.com/questions/620205/aarch64-linux-musl-cross-has-a-broken-link-for-ld-musl-aarch64-so-1
RUN wget https://musl.cc/aarch64-linux-musl-cross.tgz \
&& tar -xf aarch64-linux-musl-cross.tgz \
&& mv ./aarch64-linux-musl-cross /opt \
&& /opt/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version \
&& rm aarch64-linux-musl-cross.tgz
# allow non-root user to download more deps later
RUN chmod -R 777 /usr/local/cargo
## COPY BUILD SCRIPTS
WORKDIR /code
# Add musl Rust targets
RUN rustup target add aarch64-unknown-linux-musl x86_64-unknown-linux-musl
COPY build_muslc.sh /opt/
RUN chmod +x /opt/*.sh
RUN mkdir /.cargo
RUN chmod +rx /.cargo
COPY cargo-config /.cargo/config
CMD ["/opt/build_muslc.sh"]