From 28d68dc478b498c05bb9eccad9bd6c8f2cd0d3b6 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 28 Jul 2023 11:58:45 +0200 Subject: [PATCH] Refactoring / renaming --- .../ci/dockerfiles/binary_injected.Dockerfile | 47 +++++++++++++++++++ ...ockerfile => polkadot_injected.Dockerfile} | 2 +- ...le => polkadot_injected_debian.Dockerfile} | 0 scripts/ci/gitlab/pipeline/publish.yml | 4 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 scripts/ci/dockerfiles/binary_injected.Dockerfile rename scripts/ci/dockerfiles/{polkadot_injected_debug.Dockerfile => polkadot_injected.Dockerfile} (94%) rename scripts/ci/dockerfiles/{polkadot_injected_release.Dockerfile => polkadot_injected_debian.Dockerfile} (100%) diff --git a/scripts/ci/dockerfiles/binary_injected.Dockerfile b/scripts/ci/dockerfiles/binary_injected.Dockerfile new file mode 100644 index 000000000000..aec12061314c --- /dev/null +++ b/scripts/ci/dockerfiles/binary_injected.Dockerfile @@ -0,0 +1,47 @@ +FROM docker.io/library/ubuntu:20.04 + +# metadata +ARG VCS_REF +ARG BUILD_DATE +ARG IMAGE_NAME +ARG BINARY + +LABEL io.parity.image.authors="devops-team@parity.io" \ + io.parity.image.vendor="Parity Technologies" \ + io.parity.image.title="${IMAGE_NAME}" \ + io.parity.image.description="Polkadot: a platform for web3" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot_injected.Dockerfile" \ + io.parity.image.revision="${VCS_REF}" \ + io.parity.image.created="${BUILD_DATE}" \ + io.parity.image.documentation="https://github.com/paritytech/polkadot/" + +# show backtraces +ENV RUST_BACKTRACE 1 + +# install tools and dependencies +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + libssl1.1 \ + ca-certificates && \ +# apt cleanup + apt-get autoremove -y && \ + apt-get clean && \ + find /var/lib/apt/lists/ -type f -not -name lock -delete; \ +# add user and link ~/.local/share/polkadot to /data + useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ + mkdir -p /data /polkadot/.local/share && \ + chown -R polkadot:polkadot /data && \ + ln -s /data /polkadot/.local/share/polkadot + +# add polkadot binary to docker image +COPY ./polkadot ./polkadot-*-worker /usr/local/bin/ + +USER polkadot + +# check if executable works in this container +RUN /usr/local/bin/polkadot --version + +EXPOSE 30333 9933 9944 +VOLUME ["/polkadot"] + +ENTRYPOINT ["/usr/local/bin/polkadot"] diff --git a/scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile b/scripts/ci/dockerfiles/polkadot_injected.Dockerfile similarity index 94% rename from scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile rename to scripts/ci/dockerfiles/polkadot_injected.Dockerfile index d3aabaa19dec..9d217be6b188 100644 --- a/scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile +++ b/scripts/ci/dockerfiles/polkadot_injected.Dockerfile @@ -9,7 +9,7 @@ LABEL io.parity.image.authors="devops-team@parity.io" \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.title="${IMAGE_NAME}" \ io.parity.image.description="Polkadot: a platform for web3" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot_injected.Dockerfile" \ io.parity.image.revision="${VCS_REF}" \ io.parity.image.created="${BUILD_DATE}" \ io.parity.image.documentation="https://github.com/paritytech/polkadot/" diff --git a/scripts/ci/dockerfiles/polkadot_injected_release.Dockerfile b/scripts/ci/dockerfiles/polkadot_injected_debian.Dockerfile similarity index 100% rename from scripts/ci/dockerfiles/polkadot_injected_release.Dockerfile rename to scripts/ci/dockerfiles/polkadot_injected_debian.Dockerfile diff --git a/scripts/ci/gitlab/pipeline/publish.yml b/scripts/ci/gitlab/pipeline/publish.yml index 27fb51c7a197..757469f30342 100644 --- a/scripts/ci/gitlab/pipeline/publish.yml +++ b/scripts/ci/gitlab/pipeline/publish.yml @@ -23,8 +23,8 @@ publish-polkadot-debug-image: GIT_STRATEGY: none DOCKER_USER: ${PARITYPR_USER} DOCKER_PASS: ${PARITYPR_PASS} - # scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile - DOCKERFILE: ci/dockerfiles/polkadot_injected_debug.Dockerfile + # scripts/ci/dockerfiles/polkadot_injected.Dockerfile + DOCKERFILE: ci/dockerfiles/polkadot_injected.Dockerfile IMAGE_NAME: docker.io/paritypr/polkadot-debug needs: - job: build-linux-stable