forked from paritytech/polkadot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-ubuntu
36 lines (27 loc) · 956 Bytes
/
Dockerfile-ubuntu
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
FROM rust:latest as builder
LABEL maintainer "wangwenfu228@gmail.com"
LABEL description="This is the build stage for Polkadot. Here we create the binary."
ARG PROFILE=release
WORKDIR /polkadot
COPY . /polkadot
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y cmake pkg-config libssl-dev git clang && \
./scripts/init.sh && \
./scripts/build.sh && \
cargo build --$PROFILE
# ===== SECOND STAGE ======
FROM ubuntu:latest
LABEL maintainer "wangwenfu228@gmail.com"
LABEL description="This is the 2nd stage: a very small image where we copy the Polkadot binary."
ARG PROFILE=release
COPY --from=builder /polkadot/target/$PROFILE/polkadot /usr/local/bin
RUN apt-get update &&
apt-get install -y libssl-dev && \
rm -rf /usr/lib/python* && \
mkdir -p /root/.local/share/polkadot && \
ln -s /root/.local/share/Polkadot /data && \
rm -rf /usr/bin /usr/sbin
EXPOSE 30333 9933 9944
VOLUME ["/data"]
CMD ["/usr/local/bin/polkadot"]