Skip to content

Commit afcba18

Browse files
committed
fix docker toolchain issue
1 parent babfda3 commit afcba18

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=ubuntu:24.04
1+
ARG BASE_IMAGE=ubuntu:latest
22

33
FROM $BASE_IMAGE AS builder
44
SHELL ["/bin/bash", "-c"]
@@ -18,18 +18,22 @@ RUN apt-get update && \
1818
apt-get install -y curl build-essential protobuf-compiler clang git pkg-config libssl-dev && \
1919
rm -rf /var/lib/apt/lists/*
2020

21-
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
22-
ENV PATH="/root/.cargo/bin:${PATH}"
23-
RUN rustup update stable
24-
RUN rustup target add wasm32-unknown-unknown --toolchain stable
25-
2621
# Copy entire repository
2722
COPY . /build
2823
WORKDIR /build
2924

25+
# Install Rust
26+
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
27+
ENV PATH="/root/.cargo/bin:${PATH}"
28+
RUN rustup toolchain install
29+
RUN rustup target add wasm32-unknown-unknown
30+
3031
# Build the project
3132
RUN cargo build -p node-subtensor --profile production --features="metadata-hash" --locked
3233

34+
# Slim down image
35+
RUN rm -rf /root/.cargo
36+
3337
# Verify the binary was produced
3438
RUN test -e /build/target/production/node-subtensor
3539

0 commit comments

Comments
 (0)