Skip to content

Commit 8602c0d

Browse files
committed
github: fix cargo fetch job killed on qemu
Add workaround for docker/build-push-action#621. Fixes failing ARM Linux builds. Longer-term, we may want to explore pre-downloading with `cargo vendor` or seeing if the Rust `cross` command is any better. See Also 1. <docker/build-push-action#621>
1 parent 0333aa4 commit 8602c0d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ FROM docker.io/library/rust:${BUILD_RUST_TAG}-${BUILD_OS_TAG} AS samedec-build-d
2626

2727
ARG CARGO_BUILD_TARGET=
2828

29-
ENV CARGO_INSTALL_ROOT=/usr/local \
29+
# Fetch with CLI for Github Runners, see
30+
# <https://github.com/docker/build-push-action/issues/621>
31+
ENV CARGO_NET_GIT_FETCH_WITH_CLI="true" \
32+
CARGO_INSTALL_ROOT=/usr/local \
3033
CARGO_TERM_COLOR=always \
3134
RUST_BACKTRACE=1 \
3235
RUSTFLAGS='-C strip=symbols'
@@ -37,14 +40,17 @@ WORKDIR /build
3740
RUN cat /etc/os-release && \
3841
cargo --version
3942

40-
# Modify image OS if required
43+
# Modify image OS if required. Install git
44+
# for CARGO_NET_GIT_FETCH_WITH_CLI
4145
RUN eval "$(cat </etc/os-release)" && \
4246
case "$ID" in \
4347
alpine) \
4448
# install static musl so we can statically link
45-
apk add --no-cache musl-dev ;; \
49+
apk add --no-cache musl-dev git ;; \
4650
debian) \
4751
# record glibc version for posterity
52+
apt-get update && \
53+
apt-get install -y git && \
4854
ldd --version ldd ;; \
4955
esac
5056

0 commit comments

Comments
 (0)