Skip to content

Commit 77534df

Browse files
committed
Fix rust toolchain for alpine
1 parent b274528 commit 77534df

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

alpine/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ ARG NGINX_VERSION=stable
44

55
FROM nginx:${NGINX_VERSION}-alpine AS base-builder
66

7-
RUN apk update \
7+
RUN --mount=type=cache,id=alpine,target=/tmp/locked,sharing=locked \
8+
apk update \
89
&& apk add linux-headers openssl-dev pcre2-dev zlib-dev openssl abuild \
910
musl-dev libxslt libxml2-utils make mercurial gcc unzip git \
10-
xz g++ coreutils curl \
11+
xz g++ coreutils curl rustup \
1112
# allow abuild as a root user \
1213
&& printf "#!/bin/sh\\nSETFATTR=true /usr/bin/abuild -F \"\$@\"\\n" > /usr/local/bin/abuild \
1314
&& chmod +x /usr/local/bin/abuild
@@ -16,10 +17,10 @@ ENV RUSTUP_HOME=/usr/local/rustup \
1617
CARGO_HOME=/usr/local/cargo \
1718
PATH=/usr/local/cargo/bin:$PATH \
1819
RUST_VERSION=1.86.0
19-
COPY --from=rustup-init /rustup-init /usr/local/bin/rustup-init
20+
# COPY --from=rustup-init /rustup-init /usr/bin/rustup-init
2021
RUN --mount=type=cache,id=alpine,target=/tmp/locked,sharing=locked \
2122
set -ex; \
22-
/usr/local/bin/rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION}; \
23+
/usr/bin/rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION}; \
2324
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
2425
rustup --version; \
2526
cargo --version; \

debian/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ ARG NGINX_VERSION=stable
44

55
FROM nginx:${NGINX_VERSION} AS base-builder
66

7-
RUN apt-get update \
7+
RUN --mount=type=cache,id=alpine,target=/tmp/locked,sharing=locked \
8+
apt-get update \
89
&& apt-get install -y --no-install-suggests --no-install-recommends \
910
patch make wget git devscripts debhelper dpkg-dev \
1011
quilt lsb-release build-essential libxml2-utils xsltproc \
@@ -24,10 +25,10 @@ ENV RUSTUP_HOME=/usr/local/rustup \
2425
CARGO_HOME=/usr/local/cargo \
2526
PATH=/usr/local/cargo/bin:$PATH \
2627
RUST_VERSION=1.86.0
27-
COPY --from=rustup-init /rustup-init /usr/local/bin/rustup-init
28+
COPY --from=rustup-init /rustup-init /usr/bin/rustup-init
2829
RUN --mount=type=cache,id=alpine,target=/tmp/locked,sharing=locked \
2930
set -ex; \
30-
/usr/local/bin/rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION}; \
31+
/usr/bin/rustup-init -y --no-modify-path --profile minimal --default-toolchain ${RUST_VERSION}; \
3132
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
3233
rustup --version; \
3334
cargo --version; \

0 commit comments

Comments
 (0)