Skip to content

Commit 056e74a

Browse files
authored
feat: refactor how rust is install (#21)
Refactor so that we have more control over rust version and can use never versions than installed through apt. Recent updates to SWC for amaro required a very recent version. Signed-off-by: Michael Dawson <[email protected]>
1 parent 3e177da commit 056e74a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

container-build-info/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Modify these to update to newer versions
22
FROM node:22-alpine3.20@sha256:fc95a044b87e95507c60c1f8c829e5d98ddf46401034932499db370c494ef0ff
33
ARG BINARYEN_VERSION=116
4+
ARG RUST_VERSION=1.83.0
45

56
ARG UID=1000
67
ARG GID=1000
@@ -12,6 +13,7 @@ ENV ROOT_DIR=/home/node
1213
ENV METADATA_DIR=$ROOT_DIR/metadata
1314
RUN mkdir $METADATA_DIR
1415
ENV WORKDIR_DIR=$ROOT_DIR/build
16+
ENV PATH="$ROOT_DIR/.cargo/bin:$PATH"
1517
RUN mkdir WORKDIR_DIR
1618
WORKDIR $WORKDIR_DIR
1719

@@ -28,7 +30,7 @@ RUN apk add -U clang lld wasi-sdk
2830
RUN apk add -U clang lld wasi-sdk make
2931

3032
# those needed for amaro
31-
RUN apk add -U rust rust-wasm cargo cmake gcc g++ bash make
33+
RUN apk add -U curl rust-wasm cmake gcc g++ bash make
3234

3335
# capture the versions of the packages installed
3436
RUN apk info -v >/home/node/metadata/apk-info
@@ -63,4 +65,11 @@ RUN echo "Binaryen-version: $BINARYEN_VERSION" >$METADATA_DIR/binaryen-info
6365
RUN echo "Binaryen-url: https://github.com/WebAssembly/binaryen/releases/download/version_$BINARYEN_VERSION/binaryen-version_$BINARYEN_VERSION-$CURRENT_ARCH-linux.tar.gz" >>$METADATA_DIR/binaryen-info
6466
RUN echo "Binaryen-binary: $WASM_OPT" >>$METADATA_DIR/binaryen-info
6567

68+
RUN chmod -R 777 $METADATA_DIR
6669
USER node
70+
71+
# Install Rust
72+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >$METADATA_DIR/install_rust.sh
73+
RUN bash $METADATA_DIR/install_rust.sh -y --quiet
74+
RUN rustup install $RUST_VERSION
75+
RUN rustup default $RUST_VERSION

0 commit comments

Comments
 (0)