forked from autonomys/subspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-farmer
47 lines (32 loc) · 1.13 KB
/
Dockerfile-farmer
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
FROM ubuntu:20.04
ARG RUSTC_VERSION=nightly-2022-02-15
WORKDIR /code
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
llvm \
clang && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $RUSTC_VERSION
RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown
COPY Cargo.lock /code/Cargo.lock
COPY Cargo.toml /code/Cargo.toml
COPY crates /code/crates
COPY cumulus /code/cumulus
COPY polkadot /code/polkadot
COPY substrate /code/substrate
COPY test /code/test
# Up until this line all Rust images in this repo should be the same to share the same layers
RUN \
/root/.cargo/bin/cargo build --profile production --bin subspace-farmer && \
mv target/production/subspace-farmer subspace-farmer && \
rm -rf target
FROM ubuntu:20.04
COPY --from=0 /code/subspace-farmer /subspace-farmer
ENV SUBSPACE_DIR=/var/subspace
RUN mkdir /var/subspace && chown nobody:nogroup /var/subspace
VOLUME /var/subspace
USER nobody:nogroup
ENTRYPOINT ["/subspace-farmer"]