-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
65 lines (50 loc) · 2.28 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# **NOTE**: This docker file expects to be run in a directory outside of subtensor.
# It also expects two build arguments, the bittensor snapshot directory, and the bittensor
# snapshot file name.
# This runs typically via the following command:
# $ docker build -t subtensor . --platform linux/x86_64 --build-arg SNAPSHOT_DIR="DIR_NAME" --build-arg SNAPSHOT_FILE="FILENAME.TAR.GZ" -f subtensor/Dockerfile
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG SNAPSHOT_DIR
ARG SNAPSHOT_FILE
# This is being set so that no interactive components are allowed when updating.
ARG DEBIAN_FRONTEND=noninteractive
LABEL ai.opentensor.image.authors="operations@opentensor.ai" \
ai.opentensor.image.vendor="Opentensor Foundation" \
ai.opentensor.image.title="opentensor/subtensor" \
ai.opentensor.image.description="Opentensor Subtensor Blockchain" \
ai.opentensor.image.revision="${VCS_REF}" \
ai.opentensor.image.created="${BUILD_DATE}" \
ai.opentensor.image.documentation="https://opentensor.gitbook.io/bittensor/"
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl1.1 \
ca-certificates \
git \
curl && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete;
# Clone subtensor latest
RUN git clone https://github.com/opentensor/subtensor_exodus.git subtensor
# Install cargo and Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN subtensor/scripts/init.sh
# Install subkey
COPY subkey /subtensor
#RUN cargo install --force subkey --git https://github.com/paritytech/substrate --version 2.0.1 --locked
COPY subtensor/target/release/node-subtensor /usr/local/bin
RUN /usr/local/bin/node-subtensor --version
COPY ${SNAPSHOT_DIR}/${SNAPSHOT_FILE}.tar.gz /subtensor
RUN mkdir -p /root/.local/share/node-subtensor/chains/nakamoto_mainnet/db
RUN tar -zxvf /subtensor/${SNAPSHOT_FILE}.tar.gz -C /root/.local/share/node-subtensor/chains/nakamoto_mainnet/db
EXPOSE 30333 9933 9944