-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
30 lines (22 loc) · 1.32 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
# This file is sourced from https://github.com/paritytech/polkadot/blob/master/scripts/ci/dockerfiles/polkadot/polkadot_builder.Dockerfile
# This is the build stage for polkadot-parachain. Here we create the binary in a temporary image.
FROM docker.io/paritytech/ci-linux:production as builder
WORKDIR /origintrail-parachain
COPY . /origintrail-parachain
RUN rustup default nightly && cargo build --release
# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/library/ubuntu:20.04
COPY --from=builder /origintrail-parachain/target/release/origintrail-parachain /usr/local/bin
COPY --from=builder /origintrail-parachain/res/origintrail-parachain-2043-raw.json /config/origintrail-parachain-2043-raw.json
RUN useradd -m -u 1000 -U -s /bin/sh -d /origintrail-parachain origintrail-parachain && \
mkdir -p /data /origintrail-parachain/.local/share && \
chown -R origintrail-parachain:origintrail-parachain /data && \
ln -s /data /origintrail-parachain/.local/share/origintrail-parachain && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/origintrail-parachain --version
USER origintrail-parachain
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/origintrail-parachain"]