Reintroduce and fix Docker image build for production (#1536)

This PR brings back the GH Workflow step and some fixes to build the
docker image from the Debian package.

---------

Co-authored-by: EgorPopelyaev <egor@parity.io>
This commit is contained in:
Chevdor
2023-09-13 12:59:14 +02:00
committed by GitHub
parent f7c95c5fc1
commit 07bad23ec0
2 changed files with 123 additions and 40 deletions
@@ -1,4 +1,4 @@
FROM docker.io/library/ubuntu:20.04
FROM docker.io/parity/base-bin
# metadata
ARG VCS_REF
@@ -16,38 +16,29 @@ LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/polkadot/"
USER root
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libssl1.1 \
ca-certificates \
gnupg && \
useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \
# add repo's gpg keys and install the published polkadot binary
gpg --keyserver ${GPG_KEYSERVER} --recv-keys ${POLKADOT_GPGKEY} && \
gpg --export ${POLKADOT_GPGKEY} > /usr/share/keyrings/parity.gpg && \
echo 'deb [signed-by=/usr/share/keyrings/parity.gpg] https://releases.parity.io/deb release main' > /etc/apt/sources.list.d/parity.list && \
RUN \
apt-get update && \
apt-get install -y --no-install-recommends polkadot=${POLKADOT_VERSION#?} && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* ; \
mkdir -p /data /polkadot/.local/share && \
chown -R polkadot:polkadot /data && \
chown -R parity:parity /data && \
ln -s /data /polkadot/.local/share/polkadot
USER polkadot
USER parity
# check if executable works in this container
RUN /usr/bin/polkadot --version
RUN /usr/bin/polkadot-execute-worker --version
RUN /usr/bin/polkadot-prepare-worker --version
RUN /usr/lib/polkadot/polkadot-execute-worker --version
RUN /usr/lib/polkadot/polkadot-prepare-worker --version
EXPOSE 30333 9933 9944
EXPOSE 30333 9933 9944 9615
VOLUME ["/polkadot"]
ENTRYPOINT ["/usr/bin/polkadot"]