Files
pezkuwi-subxt/polkadot/docker/Dockerfile
T
Denis Pisarev 3800575db4 dockerfiles: upgrade to ubuntu:20.04; some chore (#3828)
* dockerfiles: upgrade to ubuntu:20.04; some chore

* dockerfiles: fq container names
2021-09-13 14:34:29 +02:00

30 lines
805 B
Docker

FROM docker.io/paritytech/ci-linux:production as builder
LABEL description="This is the build stage for Polkadot. Here we create the binary."
ARG PROFILE=release
WORKDIR /polkadot
COPY . /polkadot
RUN cargo build --$PROFILE
# ===== SECOND STAGE ======
FROM docker.io/library/ubuntu:20.04
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 useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \
mkdir -p /polkadot/.local/share && \
mkdir /data && \
chown -R polkadot:polkadot /data && \
ln -s /data /polkadot/.local/share/polkadot && \
rm -rf /usr/bin /usr/sbin
USER polkadot
EXPOSE 30333 9933 9944
VOLUME ["/data"]
CMD ["/usr/local/bin/polkadot"]