Skip to content

Commit 1ffb53b

Browse files
committed
fix
1 parent b5b98e6 commit 1ffb53b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Github/Runners/alpine-rust.dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22
#------------------------------------------------------------------------------------#
33
#https://hub.docker.com/r/pkgforge/alpine-rust
44
ARG ARCH
5-
ARG TOOLCHAIN
65
FROM "ghcr.io/pkgforge/devscripts/alpine-slim:${ARCH}"
6+
ARG TOOLCHAIN
7+
ENV R_TOOLCHAIN="${TOOLCHAIN}"
78
#------------------------------------------------------------------------------------#
89
##Setup Rust
910
RUN <<EOS
1011
set +e
12+
if [ -z "$R_TOOLCHAIN" ] || [ "$R_TOOLCHAIN" = "" ]; then
13+
exit 1
14+
fi
1115
apk update && apk upgrade --no-cache --no-interactive 2>/dev/null
1216
apk add rustup --latest --upgrade --no-cache --no-interactive 2>/dev/null
1317
hash -r >/dev/null 2>&1
14-
rustup-init --default-toolchain "${TOOLCHAIN}" --no-modify-path -y || true
18+
rustup-init --default-toolchain "$R_TOOLCHAIN" --no-modify-path -y || true
1519
if [ -d "/root/.rustup/toolchains" ] && [ "$(du -sm '/root/.rustup/toolchains' | cut -f1)" -gt 10 ]; then
1620
find "/root/.rustup/toolchains" -type d \( -path '*/share/bash' -o -path '*/share/doc' -o -path '*/share/fish' \
1721
-o -path '*/share/man' -o -path '*/share/zsh' \) -exec rm -rvf "{}" + 2>/dev/null || true

0 commit comments

Comments
 (0)