File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11ARG RUST_VERSION=1.71.1
2- FROM rust:${RUST_VERSION}
2+ FROM rust:${RUST_VERSION}-buster
33
44RUN apt update && apt upgrade -y
55
66ARG ARCH_NAME
77RUN if [ "${ARCH_NAME}" = "aarch64" ]; then \
88 # We assume the docker image's arch is x86_64, so cross-compiling for aarch64
9- apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross \
10- libssl-dev pkg-config && \
9+ apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross pkg-config && \
1110 rustup toolchain install stable-aarch64-unknown-linux-gnu --force-non-host; \
1211 fi
12+ RUN apt install -y libssl-dev
1313RUN rustup target add "${ARCH_NAME}-unknown-linux-gnu"
1414
1515WORKDIR /usr/src/app
@@ -18,7 +18,7 @@ ENV CARGO_HOME=/usr/src/app/.cargo
1818
1919ENV ARCH_NAME=${ARCH_NAME} \
2020 # Generate static builds
21- RUSTFLAGS="-C target-feature=+crt-static" \
21+ # RUSTFLAGS="-C target-feature=+crt-static" \
2222 # Use the correct linker for aarch64 target
2323 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
2424 CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
Original file line number Diff line number Diff line change 2222
2323docker build -t " rust-cross-${ARCH_NAME} " -f ./build/rust.Dockerfile --build-arg ARCH_NAME=" ${ARCH_NAME} " .
2424
25- if [ " x ${CI} " = " xtrue " ]; then
25+ if [ " ${CI} " = " true " ]; then
2626 CARGO_HOME=/tmp/.cargo cargo fetch
2727 docker run --rm --user " $( id -u) " :" $( id -g) " -v " $PWD " :/usr/src/app -v /tmp/.cargo:/usr/src/app/.cargo rust-cross-" ${ARCH_NAME} "
2828else
You can’t perform that action at this time.
0 commit comments