Skip to content

Commit b6bf2c6

Browse files
authored
fix docker build process + ARM support #1359
2 parents babfda3 + 80738c7 commit b6bf2c6

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
with:
6565
context: .
6666
push: true
67+
platforms: linux/amd64,linux/arm64
6768
tags: |
6869
ghcr.io/${{ github.repository }}:${{ env.tag }}
6970
${{ env.latest_tag == 'true' && format('ghcr.io/{0}:latest', github.repository) || '' }}

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)