diff --git a/polkadot/.github/workflows/publish-docker-release.yml b/polkadot/.github/workflows/publish-docker-release.yml index 811849c561..1c5ae13caa 100644 --- a/polkadot/.github/workflows/publish-docker-release.yml +++ b/polkadot/.github/workflows/publish-docker-release.yml @@ -29,7 +29,7 @@ jobs: uses: docker/build-push-action@v2 with: push: true - file: scripts/docker/release.Dockerfile + file: scripts/docker/polkadot_injected_release.Dockerfile tags: | parity/polkadot:latest parity/polkadot:${{ github.event.release.tag_name }} @@ -37,6 +37,7 @@ jobs: POLKADOT_VERSION=${{ github.event.release.tag_name }} VCS_REF=${{ github.ref }} BUILD_DATE=${{ github.event.release.published_at }} + GPG_KEYSERVER="hkps://keys.mailvelope.com" cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - name: Image digest diff --git a/polkadot/.gitlab-ci.yml b/polkadot/.gitlab-ci.yml index 3713d94f95..15e69605cd 100644 --- a/polkadot/.gitlab-ci.yml +++ b/polkadot/.gitlab-ci.yml @@ -210,7 +210,7 @@ test-build-linux-stable: - echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})" - echo -n ${VERSION} > ./artifacts/VERSION - echo -n ${EXTRATAG} > ./artifacts/EXTRATAG - - cp -r scripts/docker/* ./artifacts + - cp -r scripts/* ./artifacts check-runtime-benchmarks: stage: test @@ -265,7 +265,7 @@ build-adder-collator: - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - - cp -r scripts/docker/* ./artifacts + - cp -r scripts/* ./artifacts #### stage: build @@ -358,8 +358,8 @@ publish-polkadot-image: <<: *build-push-image variables: <<: *image-variables - # scripts/docker/Dockerfile - DOCKERFILE: Dockerfile + # scripts/dockerfiles/polkadot_injected_debug.Dockerfile + DOCKERFILE: dockerfiles/polkadot_injected_debug.Dockerfile IMAGE_NAME: docker.io/paritypr/synth-wave rules: # Don't run on releases - this is handled by the Github Action here: @@ -394,8 +394,8 @@ publish-adder-collator-image: <<: *build-push-image variables: <<: *image-variables - # scripts/docker/collator.Dockerfile - DOCKERFILE: collator.Dockerfile + # scripts/dockerfiles/collator_injected.Dockerfile + DOCKERFILE: dockerfiles/collator_injected.Dockerfile IMAGE_NAME: docker.io/paritypr/colander rules: - if: $CI_PIPELINE_SOURCE == "schedule" diff --git a/polkadot/doc/docker.md b/polkadot/doc/docker.md index b5cafd7ef4..0ffe6ef09a 100644 --- a/polkadot/doc/docker.md +++ b/polkadot/doc/docker.md @@ -4,9 +4,9 @@ The easiest/faster option to run Polkadot in Docker is to use the latest release images. These are small images that use the latest official release of the Polkadot binary, pulled from our package repository. -**_Following examples are running on westend chain and without SSL. They can be used to quick start and learn how Polkadot needs to be configured. Please find out how to secure your node, if you want to operate it on the internet. Do not expose rpc and ws ports, if they are not correctly configured._** +**_Following examples are running on westend chain and without SSL. They can be used to quick start and learn how Polkadot needs to be configured. Please find out how to secure your node, if you want to operate it on the internet. Do not expose RPC and WS ports, if they are not correctly configured._** -Let´s first check the version we have. The first time you run this command, the Polkadot docker image will be downloaded. This takes a bit of time and bandwidth, be patient: +Let's first check the version we have. The first time you run this command, the Polkadot docker image will be downloaded. This takes a bit of time and bandwidth, be patient: ```bash docker run --rm -it parity/polkadot:latest --version @@ -65,7 +65,7 @@ services: ] ``` -With following docker-compose.yml you can set up a node and use polkadot-js-apps as the front end on port 80. After starting the node use a browser and enter your Docker host ip in the url field: __ +With following docker-compose.yml you can set up a node and use polkadot-js-apps as the front end on port 80. After starting the node use a browser and enter your Docker host IP in the URL field: __ ```bash version: '2' @@ -118,7 +118,7 @@ To get up and running with the smallest footprint on your system, you may use th You can build it yourself (it takes a while...) in the shell session of the daemon: ```bash -cd docker +cd scripts/docker/polkadot ./build.sh ``` diff --git a/polkadot/scripts/docker/collator.Dockerfile b/polkadot/scripts/dockerfiles/collator_injected.Dockerfile similarity index 89% rename from polkadot/scripts/docker/collator.Dockerfile rename to polkadot/scripts/dockerfiles/collator_injected.Dockerfile index 7053459d1a..12cc322200 100644 --- a/polkadot/scripts/docker/collator.Dockerfile +++ b/polkadot/scripts/dockerfiles/collator_injected.Dockerfile @@ -9,8 +9,8 @@ ARG IMAGE_NAME 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="adder-collator image" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/collator.Dockerfile" \ + io.parity.image.description="Injected adder-collator Docker image" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/collator_injected.Dockerfile" \ io.parity.image.revision="${VCS_REF}" \ io.parity.image.created="${BUILD_DATE}" \ io.parity.image.documentation="https://github.com/paritytech/polkadot/" @@ -22,8 +22,7 @@ ENV RUST_BACKTRACE 1 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ libssl1.1 \ - ca-certificates \ - curl && \ + ca-certificates && \ # apt cleanup apt-get autoremove -y && \ apt-get clean && \ diff --git a/polkadot/docker/README.md b/polkadot/scripts/dockerfiles/polkadot/README.md similarity index 100% rename from polkadot/docker/README.md rename to polkadot/scripts/dockerfiles/polkadot/README.md diff --git a/polkadot/docker/build.sh b/polkadot/scripts/dockerfiles/polkadot/build.sh similarity index 80% rename from polkadot/docker/build.sh rename to polkadot/scripts/dockerfiles/polkadot/build.sh index 6456383fcd..ee4d29991a 100755 --- a/polkadot/docker/build.sh +++ b/polkadot/scripts/dockerfiles/polkadot/build.sh @@ -14,7 +14,7 @@ GITREPO=polkadot # Build the image echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!" -time docker build -f ./docker/Dockerfile --build-arg RUSTC_WRAPPER= --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest . +time docker build -f ./scripts/docker/polkadot/polkadot_builder.Dockerfile --build-arg RUSTC_WRAPPER= --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest . # Show the list of available images for this repo echo "Image is ready" diff --git a/polkadot/docker/docker-compose-local.yml b/polkadot/scripts/dockerfiles/polkadot/docker-compose-local.yml similarity index 92% rename from polkadot/docker/docker-compose-local.yml rename to polkadot/scripts/dockerfiles/polkadot/docker-compose-local.yml index 079d738252..2c93799259 100644 --- a/polkadot/docker/docker-compose-local.yml +++ b/polkadot/scripts/dockerfiles/polkadot/docker-compose-local.yml @@ -3,6 +3,7 @@ services: node_alice: build: context: . + dockerfile: polkadot_builder.Dockerfile ports: - "30333:30333" - "9933:9933" @@ -18,6 +19,7 @@ services: node_bob: build: context: . + dockerfile: polkadot_builder.Dockerfile ports: - "30344:30344" - "9935:9935" diff --git a/polkadot/docker/docker-compose.yml b/polkadot/scripts/dockerfiles/polkadot/docker-compose.yml similarity index 85% rename from polkadot/docker/docker-compose.yml rename to polkadot/scripts/dockerfiles/polkadot/docker-compose.yml index b76d41da1d..54fe158735 100644 --- a/polkadot/docker/docker-compose.yml +++ b/polkadot/scripts/dockerfiles/polkadot/docker-compose.yml @@ -3,6 +3,7 @@ services: polkadot: build: context: . + dockerfile: polkadot_builder.Dockerfile ports: - "127.0.0.1:30333:30333/tcp" - "127.0.0.1:9933:9933/tcp" diff --git a/polkadot/docker/Dockerfile b/polkadot/scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile similarity index 53% rename from polkadot/docker/Dockerfile rename to polkadot/scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile index e068ec086f..2fc5787e6c 100644 --- a/polkadot/docker/Dockerfile +++ b/polkadot/scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile @@ -1,19 +1,18 @@ FROM docker.io/paritytech/ci-linux:production as builder -LABEL description="This is the build stage for Polkadot. Here we create the binary." +LABEL io.parity.image.description="This is the build stage for Polkadot. Here we create the binary." -ARG PROFILE=release WORKDIR /polkadot COPY . /polkadot -RUN cargo build --$PROFILE +RUN cargo build --release --locked # ===== 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 +LABEL io.parity.image.description="Polkadot: a platform for web3. This is a self-buit multistage image." + +COPY --from=builder /polkadot/target/release/polkadot /usr/local/bin RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ mkdir -p /polkadot/.local/share && \ @@ -23,7 +22,7 @@ RUN useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ rm -rf /usr/bin /usr/sbin USER polkadot -EXPOSE 30333 9933 9944 +EXPOSE 30333 9933 9944 9615 VOLUME ["/data"] -CMD ["/usr/local/bin/polkadot"] +ENTRYPOINT ["/usr/local/bin/polkadot"] diff --git a/polkadot/scripts/docker/Dockerfile b/polkadot/scripts/dockerfiles/polkadot_injected_debug.Dockerfile similarity index 93% rename from polkadot/scripts/docker/Dockerfile rename to polkadot/scripts/dockerfiles/polkadot_injected_debug.Dockerfile index 51f2b21b5f..7ba312bf8b 100644 --- a/polkadot/scripts/docker/Dockerfile +++ b/polkadot/scripts/dockerfiles/polkadot_injected_debug.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/docker/Dockerfile" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/polkadot_injected_debug.Dockerfile" \ io.parity.image.revision="${VCS_REF}" \ io.parity.image.created="${BUILD_DATE}" \ io.parity.image.documentation="https://github.com/paritytech/polkadot/" @@ -21,8 +21,7 @@ ENV RUST_BACKTRACE 1 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ libssl1.1 \ - ca-certificates \ - curl && \ + ca-certificates && \ # apt cleanup apt-get autoremove -y && \ apt-get clean && \ diff --git a/polkadot/scripts/docker/release.Dockerfile b/polkadot/scripts/dockerfiles/polkadot_injected_release.Dockerfile similarity index 76% rename from polkadot/scripts/docker/release.Dockerfile rename to polkadot/scripts/dockerfiles/polkadot_injected_release.Dockerfile index 9188d6b260..c4c8aea182 100644 --- a/polkadot/scripts/docker/release.Dockerfile +++ b/polkadot/scripts/dockerfiles/polkadot_injected_release.Dockerfile @@ -4,12 +4,14 @@ FROM docker.io/library/ubuntu:20.04 ARG VCS_REF ARG BUILD_DATE ARG POLKADOT_VERSION +ARG POLKADOT_GPGKEY=9D4B2B6EB8F97156D19669A9FF0812D491B96798 +ARG GPG_KEYSERVER="hkps://keys.mailvelope.com" LABEL io.parity.image.authors="devops-team@parity.io" \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.title="parity/polkadot" \ - io.parity.image.description="Polkadot: a platform for web3" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/Dockerfile" \ + io.parity.image.description="Polkadot: a platform for web3. This is the official Parity image with an injected binary." \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/polkadot_injected_release.Dockerfile" \ io.parity.image.revision="${VCS_REF}" \ io.parity.image.created="${BUILD_DATE}" \ io.parity.image.documentation="https://github.com/paritytech/polkadot/" @@ -22,12 +24,11 @@ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ libssl1.1 \ ca-certificates \ - curl \ gnupg && \ useradd -m -u 1000 -U -s /bin/sh -d /polkadot polkadot && \ # add repo's gpg keys and install the published polkadot binary - gpg --recv-keys --keyserver hkps://keys.mailvelope.com 9D4B2B6EB8F97156D19669A9FF0812D491B96798 && \ - gpg --export 9D4B2B6EB8F97156D19669A9FF0812D491B96798 > /usr/share/keyrings/parity.gpg && \ + gpg --recv-keys --keyserver ${GPG_KEYSERVER} ${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 && \ apt-get update && \ apt-get install -y --no-install-recommends polkadot=${POLKADOT_VERSION#?} && \ diff --git a/polkadot/scripts/docker/staking-miner/staking_miner-builder.Dockerfile b/polkadot/scripts/dockerfiles/staking-miner/staking-miner_builder.Dockerfile similarity index 90% rename from polkadot/scripts/docker/staking-miner/staking_miner-builder.Dockerfile rename to polkadot/scripts/dockerfiles/staking-miner/staking-miner_builder.Dockerfile index 4903fccee5..5208dfb65f 100644 --- a/polkadot/scripts/docker/staking-miner/staking_miner-builder.Dockerfile +++ b/polkadot/scripts/dockerfiles/staking-miner/staking-miner_builder.Dockerfile @@ -19,8 +19,8 @@ LABEL description="This is the 2nd stage: a very small image where we copy the b 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="staking-miner for substrate based chains" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/staking-miner/staking_miner-builder.Dockerfile" \ + io.parity.image.description="${IMAGE_NAME} for substrate based chains" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/${IMAGE_NAME}/${IMAGE_NAME}_builder.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/polkadot/scripts/docker/staking-miner/staking_miner-injected.Dockerfile b/polkadot/scripts/dockerfiles/staking-miner/staking-miner_injected.Dockerfile similarity index 89% rename from polkadot/scripts/docker/staking-miner/staking_miner-injected.Dockerfile rename to polkadot/scripts/dockerfiles/staking-miner/staking-miner_injected.Dockerfile index 547fea747b..2d98504b2c 100644 --- a/polkadot/scripts/docker/staking-miner/staking_miner-injected.Dockerfile +++ b/polkadot/scripts/dockerfiles/staking-miner/staking-miner_injected.Dockerfile @@ -8,8 +8,8 @@ ARG IMAGE_NAME="staking-miner" 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="staking-miner for substrate based chains" \ - io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/staking-miner/staking_miner-injected.Dockerfile" \ + io.parity.image.description="${IMAGE_NAME} for substrate based chains" \ + io.parity.image.source="https://github.com/paritytech/polkadot/blob/${VCS_REF}/scripts/docker/${IMAGE_NAME}/${IMAGE_NAME}_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/polkadot/scripts/gitlab/lingua.dic b/polkadot/scripts/gitlab/lingua.dic index 9effe75e44..68001b64a4 100644 --- a/polkadot/scripts/gitlab/lingua.dic +++ b/polkadot/scripts/gitlab/lingua.dic @@ -198,6 +198,7 @@ proxy/G proxying PRs PVF/S +p2p README/MS redhat/M register/CD @@ -227,6 +228,7 @@ spawn/SR spawner SS58 sr25519 +SSL startup/MS stateful str @@ -283,6 +285,7 @@ versa version/DMSG versioned VMP/SM +VPS VRF/SM w3f/MS wakeups @@ -293,9 +296,11 @@ Westend/M wildcard/MS WND/S Wococo +WS XCM/S XCMP/M yeet +yml decrement DM ParaId diff --git a/polkadot/utils/staking-miner/README.md b/polkadot/utils/staking-miner/README.md index f5c68a648c..944f870d6d 100644 --- a/polkadot/utils/staking-miner/README.md +++ b/polkadot/utils/staking-miner/README.md @@ -30,7 +30,7 @@ There are 2 options to build a staking-miner Docker image: First build the binary as documented [above](#building). You may then inject the binary into a Docker base image usingfrom the root of the Polkadot repository: ``` -docker build -t staking-miner -f scripts/docker/staking-miner/staking_miner-injected.Dockerfile target/release +docker build -t staking-miner -f scripts/docker/staking-miner/staking-miner_injected.Dockerfile target/release ``` ### Building the multi-stage image @@ -39,7 +39,7 @@ Unlike the injected image that requires a Linux pre-built binary, this option do The trade-off however is that it takes a little longer to build and this option is less ideal for CI tasks. You may build the multi-stage image the root of the Polkadot repository with: ``` -docker build -t staking-miner -f scripts/docker/staking-miner/staking_miner-builder.Dockerfile . +docker build -t staking-miner -f scripts/docker/staking-miner/staking-miner_builder.Dockerfile . ``` ### Running