forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 886 Bytes
/
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
FROM alpine:edge AS builder
LABEL maintainer="[email protected]"
LABEL description="This is the build stage for Substrate. Here we create the binary."
RUN apk add build-base \
cmake \
linux-headers \
openssl-dev \
clang-dev \
cargo
ARG PROFILE=release
WORKDIR /substrate
COPY . /substrate
RUN cargo build --$PROFILE
# ===== SECOND STAGE ======
FROM alpine:edge
LABEL maintainer="[email protected]"
LABEL description="This is the 2nd stage: a very small image where we copy the Substrate binary."
ARG PROFILE=release
COPY --from=builder /substrate/target/$PROFILE/substrate /usr/local/bin
RUN apk add --no-cache ca-certificates \
libstdc++ \
openssl
RUN rm -rf /usr/lib/python* && \
mkdir -p /root/.local/share/Substrate && \
ln -s /root/.local/share/Substrate /data
EXPOSE 30333 9933 9944
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/substrate"]