-
Notifications
You must be signed in to change notification settings - Fork 155
/
Dockerfile
44 lines (32 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
ARG BASE_IMAGE=ubuntu:20.04
FROM $BASE_IMAGE AS builder
SHELL ["/bin/bash", "-c"]
# Set noninteractive mode for apt-get
ARG DEBIAN_FRONTEND=noninteractive
LABEL ai.opentensor.image.authors="[email protected]" \
ai.opentensor.image.vendor="Opentensor Foundation" \
ai.opentensor.image.title="opentensor/subtensor" \
ai.opentensor.image.description="Opentensor Subtensor Blockchain" \
ai.opentensor.image.documentation="https://docs.bittensor.com"
# Set up Rust environment
ENV RUST_BACKTRACE=1
RUN apt-get update && \
apt-get install -y curl build-essential protobuf-compiler clang git && \
rm -rf /var/lib/apt/lists/*
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup update stable
RUN rustup target add wasm32-unknown-unknown --toolchain stable
# Copy entire repository
COPY . /build
WORKDIR /build
# Build the project
RUN cargo build -p node-subtensor --profile production --features="metadata-hash" --locked
# Verify the binary was produced
RUN test -e /build/target/production/node-subtensor
EXPOSE 30333 9933 9944
FROM $BASE_IMAGE AS subtensor
# Copy all chainspec files
COPY --from=builder /build/*.json /
# Copy final binary
COPY --from=builder /build/target/production/node-subtensor /usr/local/bin