-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
65 lines (48 loc) · 1.89 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
ARG BASE_IMAGE=ubuntu:20.04
FROM $BASE_IMAGE as builder
SHELL ["/bin/bash", "-c"]
# This is being set so that no interactive components are allowed when updating.
ARG DEBIAN_FRONTEND=noninteractive
LABEL ai.basedprelude.image.authors="[email protected]" \
ai.basedprelude.image.vendor="Based Labs" \
ai.basedprelude.image.title="basedprelude/basednode" \
ai.basedprelude.image.description="BasedAI Node" \
ai.basedprelude.image.revision="${VCS_REF}" \
ai.basedprelude.image.created="${BUILD_DATE}" \
ai.basedprelude.image.documentation="https://docs.basedai.ai"
# show backtraces
ENV RUST_BACKTRACE 1
# Necessary libraries for Rust execution
RUN apt-get update && \
apt-get install -y curl build-essential protobuf-compiler clang git && \
rm -rf /var/lib/apt/lists/*
# Install cargo and Rust
RUN set -o pipefail && curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN mkdir -p /basednode && \
mkdir /basednode/scripts
# Scripts
COPY ./scripts/init.sh /basednode/scripts/
# Capture dependencies
COPY Cargo.lock Cargo.toml /basednode/
# Specs
COPY ./snapshot.json /basednode/snapshot.json
COPY ./raw_spec.json /basednode/raw_spec.json
COPY ./raw_testspec.json /basednode/raw_testspec.json
# Copy our sources
COPY ./integration-tests /basednode/integration-tests
COPY ./node /basednode/node
COPY ./pallets /basednode/pallets
COPY ./runtime /basednode/runtime
# Update to nightly toolchain
COPY rust-toolchain.toml /basednode/
RUN /basednode/scripts/init.sh
# Cargo build
WORKDIR /basednode
RUN cargo build --release --features runtime-benchmarks --locked
EXPOSE 30333 9933 9944
FROM $BASE_IMAGE AS basednode
COPY --from=builder /basednode/snapshot.json /
COPY --from=builder /basednode/raw_spec.json /
COPY --from=builder /basednode/raw_testspec.json /
COPY --from=builder /basednode/target/release/basednode /usr/local/bin