-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
44 lines (34 loc) · 968 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
39
40
41
42
43
44
###################
# --- builder --- #
###################
FROM docker.io/rust:1.81 AS builder
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install \
libclang-dev protobuf-compiler
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN rustup target add wasm32-unknown-unknown
RUN rustup component add rust-src
WORKDIR /opt
ARG VERSION=polkadot-stable2409
RUN git clone https://github.com/paritytech/polkadot-sdk.git -b $VERSION --depth 1
WORKDIR /opt/polkadot-sdk
RUN cargo build --release --package polkadot
##################
# --- runner --- #
##################
FROM docker.io/debian:12-slim
RUN addgroup --gid 65532 nonroot \
&& adduser --system --uid 65532 --gid 65532 --home /home/nonroot nonroot
COPY --from=builder /opt/polkadot-sdk/target/release/polkadot /usr/local/bin/polkadot
USER 65532
# P2P
EXPOSE 30333
# RPC
EXPOSE 9933
# WS
EXPOSE 9944
# Prometheus
EXPOSE 9615
VOLUME /data
ENTRYPOINT [ "/usr/local/bin/polkadot" ]