feat: initialize Kurdistan SDK - independent fork of Polkadot SDK

This commit is contained in:
2025-12-13 15:44:15 +03:00
commit e4778b4576
6838 changed files with 1847450 additions and 0 deletions
@@ -0,0 +1,48 @@
FROM docker.io/paritytech/base-bin
# This file allows building a Generic container image
# based on one or multiple pre-built Linux binaries.
# Some defaults are set to polkadot but all can be overridden.
SHELL ["/bin/bash", "-c"]
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG IMAGE_NAME
# That can be a single one or a comma separated list
ARG BINARY=polkadot
ARG BIN_FOLDER=.
ARG DOC_URL=https://github.com/pezkuwichain/pezkuwichain-sdk
ARG DESCRIPTION="Polkadot: a platform for web3"
ARG AUTHORS="devops-team@parity.io"
ARG VENDOR="Parity Technologies"
LABEL io.parity.image.authors=${AUTHORS} \
io.parity.image.vendor="${VENDOR}" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.title="${IMAGE_NAME}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="${DOC_URL}" \
io.parity.image.description="${DESCRIPTION}" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/binary_injected.Dockerfile"
USER root
WORKDIR /app
# add binary to docker image
# sample for polkadot: COPY ./polkadot ./polkadot-*-worker /usr/local/bin/
COPY entrypoint.sh .
COPY "bin/*" "/usr/local/bin/"
RUN chmod -R a+rx "/usr/local/bin"
USER parity
ENV BINARY=${BINARY}
# ENTRYPOINT
ENTRYPOINT ["/app/entrypoint.sh"]
# We call the help by default
CMD ["--help"]
@@ -0,0 +1,59 @@
# this image is built on top of existing Zombienet image
ARG ZOMBIENET_IMAGE
# this image uses substrate-relay image built elsewhere
ARG SUBSTRATE_RELAY_IMAGE=docker.io/paritytech/substrate-relay:v1.8.0
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG IMAGE_NAME
# we need `substrate-relay` binary, built elsewhere
FROM ${SUBSTRATE_RELAY_IMAGE} as relay-builder
# the base image is the zombienet image - we are planning to run zombienet tests using native
# provider here
FROM ${ZOMBIENET_IMAGE}
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="Bridges Zombienet tests." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/bridges/testing"
# show backtraces
ENV RUST_BACKTRACE 1
USER root
# for native provider to work (TODO: fix in zn docker?)
RUN apt-get update && apt-get install -y procps sudo
RUN yarn global add @polkadot/api-cli
# add polkadot binary to the docker image
COPY ./artifacts/polkadot /usr/local/bin/
COPY ./artifacts/polkadot-execute-worker /usr/local/bin/
COPY ./artifacts/polkadot-prepare-worker /usr/local/bin/
# add polkadot-parachain binary to the docker image
COPY ./artifacts/polkadot-parachain /usr/local/bin
# copy substrate-relay to the docker image
COPY --from=relay-builder /home/user/substrate-relay /usr/local/bin/
# we need bridges zombienet runner and tests
RUN mkdir -p /home/nonroot/bridges-polkadot-sdk
COPY ./artifacts/bridges-polkadot-sdk /home/nonroot/bridges-polkadot-sdk
# also prepare `generate_hex_encoded_call` for running
RUN set -eux; \
cd /home/nonroot/bridges-polkadot-sdk/bridges/testing/framework/utils/generate_hex_encoded_call; \
npm install
# use the non-root user
USER node
# check if executable works in this container
RUN /usr/local/bin/polkadot --version
RUN /usr/local/bin/polkadot-parachain --version
RUN /usr/local/bin/substrate-relay --version
# https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:{PORT}#/explorer
EXPOSE 9942 9910 8943 9945 9010 8945
@@ -0,0 +1,49 @@
# this file copies from scripts/ci/dockerfiles/Dockerfile and changes only the binary name
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Injected adder-collator Docker image" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/collator_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
# 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/adder-collator to /data
useradd -m -u 1000 -U -s /bin/sh -d /adder-collator adder-collator && \
mkdir -p /data /adder-collator/.local/share && \
chown -R adder-collator:adder-collator /data && \
ln -s /data /adder-collator/.local/share/polkadot
# add adder-collator binary to docker image
COPY ./artifacts/adder-collator /usr/local/bin
COPY ./artifacts/undying-collator /usr/local/bin
USER adder-collator
# check if executable works in this container
RUN /usr/local/bin/adder-collator --version
RUN /usr/local/bin/undying-collator --version
EXPOSE 30333 9933 9944
VOLUME ["/adder-collator"]
ENTRYPOINT ["/usr/local/bin/adder-collator"]
+129
View File
@@ -0,0 +1,129 @@
version: '3.7'
services:
node_alice:
image: "pezkuwi:${BRANCH:-cumulus-branch}"
ports:
- "30333:30333"
- "9933:9933"
- "9944:9944"
volumes:
- "pezkuwi-data-alice:/data"
- type: bind
source: ./test/teyrchain/chain-specs/pezkuwi_chainspec.json
target: /chainspec.json
read_only: true
command: >
pezkuwi
--chain=/chainspec.json
--base-path=/data
--port 30333
--rpc-port 9933
--ws-port 9944
--rpc-external
--rpc-cors all
--ws-external
--alice
networks:
testing_net:
ipv4_address: 172.28.1.1
aliases:
- alice
node_bob:
image: "pezkuwi:${BRANCH:-cumulus-branch}"
ports:
- "30344:30333"
- "9935:9933"
- "9945:9944"
volumes:
- "pezkuwi-data-bob:/data"
- type: bind
source: ./test/teyrchain/chain-specs/pezkuwi_chainspec.json
target: /chainspec.json
read_only: true
command: >
pezkuwi
--chain=/chainspec.json
--base-path=/data
--port 30333
--rpc-port 9933
--ws-port 9944
--rpc-external
--ws-external
--rpc-cors all
--bob
networks:
testing_net:
ipv4_address: 172.28.1.2
aliases:
- bob
genesis_state:
build:
context: .
dockerfile: ./docker/dockerfiles/test-teyrchain-collator.Dockerfile
image: "ctpc:latest"
volumes:
- "genesis-state:/data"
command: >
pezkuwi-teyrchain
export-genesis-state
/data/genesis-state
collator:
build:
context: .
dockerfile: ./docker/dockerfiles/test-teyrchain-collator.Dockerfile
target: collator
image: "ctpc:collator"
volumes:
- "collator-data:/data"
depends_on:
- node_alice
- node_bob
command: >
inject_bootnodes.sh
--base-path=/data
networks:
testing_net:
runtime:
build:
context: .
dockerfile: ./docker/dockerfiles/test-teyrchain-collator.Dockerfile
target: runtime
image: "ctpc:runtime"
volumes:
- "teyrchain-runtime:/runtime"
registrar:
build:
context: .
dockerfile: ./docker/dockerfiles/teyrchain-registrar.Dockerfile
image: para-reg:latest
volumes:
- "genesis-state:/genesis"
- "teyrchain-runtime:/runtime"
depends_on:
- node_alice
- runtime
- genesis_state
networks:
testing_net:
volumes:
pezkuwi-data-alice:
pezkuwi-data-bob:
collator-data:
genesis-state:
teyrchain-runtime:
networks:
testing_net:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
@@ -0,0 +1,50 @@
FROM debian:bullseye-slim
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Malus - the nemesis of polkadot" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/malus_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates \
curl \
libssl1.1 \
tini && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete; \
# add user
groupadd --gid 10000 nonroot && \
useradd --home-dir /home/nonroot \
--create-home \
--shell /bin/bash \
--gid nonroot \
--groups nonroot \
--uid 10000 nonroot
# add adder-collator binary to docker image
COPY ./artifacts/malus ./artifacts/polkadot-execute-worker ./artifacts/polkadot-prepare-worker /usr/local/bin
USER nonroot
# check if executable works in this container
RUN /usr/local/bin/malus --version
# Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
ENTRYPOINT ["tini", "--", "/bin/bash"]
@@ -0,0 +1,49 @@
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Cumulus, the Polkadot collator." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot-parachain/polkadot-parachain-debug_unsigned_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/tree/master/cumulus"
# 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 \
curl && \
# 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-parachain to /data
useradd -m -u 1000 -U -s /bin/sh -d /polkadot-parachain polkadot-parachain && \
mkdir -p /data /polkadot-parachain/.local/share && \
chown -R polkadot-parachain:polkadot-parachain /data && \
ln -s /data /polkadot-parachain/.local/share/polkadot-parachain && \
mkdir -p /specs
# add polkadot-parachain binary to the docker image
COPY ./artifacts/polkadot-parachain /usr/local/bin
COPY ./cumulus/parachains/chain-specs/*.json /specs/
USER polkadot-parachain
# check if executable works in this container
RUN /usr/local/bin/polkadot-parachain --version
EXPOSE 30333 9933 9944
VOLUME ["/polkadot-parachain"]
ENTRYPOINT ["/usr/local/bin/polkadot-parachain"]
@@ -0,0 +1,36 @@
# This file is sourced from https://github.com/pezkuwichain/pezkuwichain-sdk/blob/master/docker/dockerfiles/polkadot-parachain/polkadot-parachain_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 /cumulus
COPY . /cumulus
RUN cargo build --release --locked -p polkadot-parachain
# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/library/ubuntu:20.04
LABEL io.parity.image.type="builder" \
io.parity.image.authors="devops-team@parity.io" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.description="Multistage Docker image for polkadot-parachain" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot-parachain/polkadot-parachain_builder.Dockerfile" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/tree/master/cumulus"
COPY --from=builder /cumulus/target/release/polkadot-parachain /usr/local/bin
RUN useradd -m -u 1000 -U -s /bin/sh -d /cumulus polkadot-parachain && \
mkdir -p /data /cumulus/.local/share && \
chown -R polkadot-parachain:polkadot-parachain /data && \
ln -s /data /cumulus/.local/share/polkadot-parachain && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/polkadot-parachain --version
USER polkadot-parachain
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/polkadot-parachain"]
@@ -0,0 +1,38 @@
FROM docker.io/paritytech/base-bin
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Cumulus, the Polkadot collator." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot-parachain/polkadot-parachain_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
# show backtraces
ENV RUST_BACKTRACE 1
USER root
RUN mkdir -p /specs
# add polkadot-parachain binary to the docker image
COPY bin/* /usr/local/bin/
COPY specs/* /specs/
RUN chmod -R a+rx "/usr/local/bin"
USER parity
# check if executable works in this container
RUN /usr/local/bin/polkadot-parachain --version
EXPOSE 30333 9933 9944 9615
VOLUME ["/polkadot", "/specs"]
ENTRYPOINT ["/usr/local/bin/polkadot-parachain"]
+9
View File
@@ -0,0 +1,9 @@
# Self built Docker image
The PezkuwiChain repo contains several options to build Docker images for PezkuwiChain.
This folder contains a self-contained image that does not require a Linux pre-built binary.
Instead, building the image is possible on any host having docker installed and will
build PezkuwiChain inside Docker. That also means that no Rust toolchain is required on the host
machine for the build to succeed.
@@ -0,0 +1,50 @@
version: '3'
services:
node_alice:
ports:
- "30333:30333"
- "9933:9933"
- "9944:9944"
- "9615:9615"
image: pezkuwichain/pezkuwi:latest
volumes:
- "pezkuwi-data-alice:/data"
command: |
--chain=pezkuwi-local
--alice
-d /data
--node-key 0000000000000000000000000000000000000000000000000000000000000001
networks:
testing_net:
ipv4_address: 172.28.1.1
node_bob:
ports:
- "30344:30333"
- "9935:9933"
- "9945:9944"
- "29615:9615"
image: pezkuwichain/pezkuwi:latest
volumes:
- "pezkuwi-data-bob:/data"
links:
- "node_alice:alice"
command: |
--chain=pezkuwi-local
--bob
-d /data
--bootnodes '/ip4/172.28.1.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR'
networks:
testing_net:
ipv4_address: 172.28.1.2
volumes:
pezkuwi-data-alice:
pezkuwi-data-bob:
networks:
testing_net:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
@@ -0,0 +1,22 @@
version: '3'
services:
pezkuwi:
image: pezkuwichain/pezkuwi:latest
ports:
- "127.0.0.1:30333:30333/tcp"
- "127.0.0.1:9933:9933/tcp"
- "127.0.0.1:9944:9944/tcp"
- "127.0.0.1:9615:9615/tcp"
volumes:
- "pezkuwi-data:/data"
command: |
--unsafe-rpc-external
--unsafe-ws-external
--rpc-cors all
--prometheus-external
volumes:
pezkuwi-data:
@@ -0,0 +1,7 @@
# Pezkuwi official Docker image
## [Pezkuwi](https://pezkuwichain.io/)
## [GitHub](https://github.com/paritytech/polkadot)
## [Pezkuwi Wiki](https://wiki.network.pezkuwichain.io/)
@@ -0,0 +1,37 @@
# This is the build stage for Polkadot. Here we create the binary in a temporary image.
FROM docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202507112050 as builder
WORKDIR /polkadot
COPY . /polkadot
RUN cargo build --locked --release
# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/paritytech/base-bin:latest
LABEL description="Multistage Docker image for Polkadot: a platform for web3" \
io.parity.image.type="builder" \
io.parity.image.authors="chevdor@gmail.com, devops-team@parity.io" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.description="Polkadot: a platform for web3" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot/polkadot_builder.Dockerfile" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
COPY --from=builder /polkadot/target/release/polkadot /usr/local/bin
USER root
RUN useradd -m -u 1001 -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 && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/polkadot --version
USER polkadot
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/polkadot"]
@@ -0,0 +1,52 @@
FROM docker.io/paritytech/base-bin
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG IMAGE_NAME
# That can be a single one or a comma separated list
ARG BINARY=polkadot
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. This is the official Parity image with an injected binary." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot/polkadot_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
# show backtraces
ENV RUST_BACKTRACE 1
USER root
WORKDIR /app
# add polkadot and polkadot-*-worker binaries to the docker image
COPY bin/* /usr/local/bin/
COPY entrypoint.sh .
RUN chmod -R a+rx "/usr/local/bin"; \
mkdir -p /data /polkadot/.local/share && \
chown -R parity:parity /data && \
ln -s /data /polkadot/.local/share/polkadot
USER parity
# check if executable works in this container
RUN /usr/local/bin/polkadot --version
RUN /usr/local/bin/polkadot-prepare-worker --version
RUN /usr/local/bin/polkadot-execute-worker --version
EXPOSE 30333 9933 9944 9615
VOLUME ["/polkadot"]
ENV BINARY=${BINARY}
# ENTRYPOINT
ENTRYPOINT ["/app/entrypoint.sh"]
# We call the help by default
CMD ["--help"]
@@ -0,0 +1,42 @@
FROM docker.io/paritytech/base-bin
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG POLKADOT_VERSION
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. This is the official Parity image with an injected binary." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/scripts/ci/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
USER root
# show backtraces
ENV RUST_BACKTRACE 1
RUN \
apt-get update && \
apt-get install -y --no-install-recommends polkadot=${POLKADOT_VERSION#?} && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* ; \
mkdir -p /data /polkadot/.local/share && \
chown -R parity:parity /data && \
ln -s /data /polkadot/.local/share/polkadot
USER parity
# check if executable works in this container
RUN /usr/bin/polkadot --version
RUN /usr/lib/polkadot/polkadot-execute-worker --version
RUN /usr/lib/polkadot/polkadot-prepare-worker --version
EXPOSE 30333 9933 9944 9615
VOLUME ["/polkadot"]
ENTRYPOINT ["/usr/bin/polkadot"]
@@ -0,0 +1,51 @@
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Polkadot: a platform for web3" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk"
# 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 /polkdot/runtimes && \
chown -R polkadot:polkadot /data && \
ln -s /data /polkadot/.local/share/polkadot
# add polkadot binaries to docker image
COPY ./artifacts/polkadot ./artifacts/polkadot-execute-worker ./artifacts/polkadot-prepare-worker /usr/local/bin
# add runtime binaries to docker image
COPY ./artifacts/runtimes /polkadot/runtimes/
USER polkadot
# check if executable works in this container
RUN /usr/local/bin/polkadot --version
RUN /usr/local/bin/polkadot-execute-worker --version
RUN /usr/local/bin/polkadot-prepare-worker --version
EXPOSE 30333 9933 9944
VOLUME ["/polkadot"]
ENTRYPOINT ["/usr/local/bin/polkadot"]
@@ -0,0 +1,53 @@
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
ARG POLKADOT_VERSION
ARG POLKADOT_GPGKEY=9D4B2B6EB8F97156D19669A9FF0812D491B96798
ARG GPG_KEYSERVER="keyserver.ubuntu.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. This is the official Parity image with an injected binary." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/polkadot/polkadot_injected_release.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/"
# 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 && \
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 && \
ln -s /data /polkadot/.local/share/polkadot
USER polkadot
# check if executable works in this container
RUN /usr/bin/polkadot --version
RUN /usr/local/bin/polkadot-execute-worker --version
RUN /usr/local/bin/polkadot-prepare-worker --version
EXPOSE 30333 9933 9944
VOLUME ["/polkadot"]
ENTRYPOINT ["/usr/bin/polkadot"]
@@ -0,0 +1,45 @@
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Substrate: The platform for blockchain innovators." \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/substrate_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://wiki.parity.io/Parity-Substrate"
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl1.1 \
ca-certificates \
curl && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete; \
# add user
useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate
# add substrate binary to docker image
COPY ./artifacts/substrate /usr/local/bin
USER substrate
# check if executable works in this container
RUN /usr/local/bin/substrate --version
EXPOSE 30333 9933 9944
VOLUME ["/substrate"]
ENTRYPOINT ["/usr/local/bin/substrate"]
@@ -0,0 +1,46 @@
# This file is sourced from https://github.com/pezkuwichain/pezkuwichain-sdk/blob/master/docker/dockerfiles/test-parachain-collator.Dockerfile
FROM docker.io/paritytech/ci-linux:production as builder
WORKDIR /cumulus
COPY . /cumulus
RUN cargo build --release --locked -p polkadot-parachain
# the collator stage is normally built once, cached, and then ignored, but can
# be specified with the --target build flag. This adds some extra tooling to the
# image, which is required for a launcher script. The script simply adds two
# arguments to the list passed in:
#
# --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/PEER_ID
#
# with the appropriate ip and ID for both Alice and Bob
FROM debian:buster-slim as collator
RUN apt-get update && apt-get install jq curl bash -y && \
curl -sSo /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
chmod +x /wait-for-it.sh && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs && \
npm install --global yarn && \
yarn global add @polkadot/api-cli@0.10.0-beta.14
COPY --from=builder \
/paritytech/cumulus/target/release/polkadot-parachain /usr/bin
COPY ./docker/scripts/inject_bootnodes.sh /usr/bin
CMD ["/usr/bin/inject_bootnodes.sh"]
COPY ./docker/scripts/healthcheck.sh /usr/bin/
HEALTHCHECK --interval=300s --timeout=75s --start-period=30s --retries=3 \
CMD ["/usr/bin/healthcheck.sh"]
# the runtime stage is normally built once, cached, and ignored, but can be
# specified with the --target build flag. This just preserves one of the builder's
# outputs, which can then be moved into a volume at runtime
FROM debian:buster-slim as runtime
COPY --from=builder \
/paritytech/cumulus/target/release/wbuild/cumulus-test-parachain-runtime/cumulus_test_parachain_runtime.compact.wasm \
/var/opt/
CMD ["cp", "-v", "/var/opt/cumulus_test_parachain_runtime.compact.wasm", "/runtime/"]
FROM debian:buster-slim
COPY --from=builder \
/paritytech/cumulus/target/release/polkadot-parachain /usr/bin
CMD ["/usr/bin/polkadot-parachain"]
@@ -0,0 +1,49 @@
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
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="Test parachain for Zombienet" \
io.parity.image.source="https://github.com/pezkuwichain/pezkuwichain-sdk/blob/${VCS_REF}/docker/dockerfiles/test-parachain_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/pezkuwichain/pezkuwichain-sdk/tree/master/cumulus"
# 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 \
curl && \
# 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/test-parachain to /data
useradd -m -u 10000 -U -s /bin/sh -d /test-parachain test-parachain && \
mkdir -p /data /test-parachain/.local/share && \
chown -R test-parachain:test-parachain /data && \
ln -s /data /test-parachain/.local/share/test-parachain && \
mkdir -p /specs
# add test-parachain binary to the docker image
COPY ./artifacts/test-parachain /usr/local/bin
COPY ./cumulus/parachains/chain-specs/*.json /specs/
USER test-parachain
# check if executable works in this container
RUN /usr/local/bin/test-parachain --version
EXPOSE 30333 9933 9944
VOLUME ["/test-parachain"]
ENTRYPOINT ["/usr/local/bin/test-parachain"]
@@ -0,0 +1,27 @@
FROM node:latest AS pjs
# It would be great to depend on a more stable tag, but we need some
# as-yet-unreleased features.
RUN yarn global add @polkadot/api-cli@0.10.0-beta.14
ENTRYPOINT [ "polkadot-js-api" ]
CMD [ "--version" ]
# To use the pjs build stage to access the blockchain from the host machine:
#
# docker build -f docker/dockerfiles/parachain-registrar.Dockerfile --target pjs -t parachain-registrar:pjs .
# alias pjs='docker run --rm --net cumulus_testing_net parachain-registrar:pjs --ws ws://172.28.1.1:9944'
#
# Then, as long as the chain is running, you can use the polkadot-js-api CLI like:
#
# pjs query.sudo.key
FROM pjs
RUN apt-get update && apt-get install curl netcat -y && \
curl -sSo /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && \
chmod +x /wait-for-it.sh
# the only thing left to do is to actually run the transaction.
COPY ./docker/scripts/register_para.sh /usr/bin
# unset the previous stage's entrypoint
ENTRYPOINT []
CMD [ "/usr/bin/register_para.sh" ]
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=adder-collator,undying-collator
export ARTIFACTS_FOLDER=$1
$PROJECT_ROOT/docker/scripts/build-injected.sh
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
TMP=$(mktemp -d)
ENGINE=${ENGINE:-podman}
# TODO: Switch to /bin/bash when the image is built from parity/base-bin
# Fetch some binaries
$ENGINE run --user root --rm -i \
--pull always \
-v "$TMP:/export" \
--entrypoint /usr/bin/bash \
paritypr/colander:master -c \
'cp "$(which adder-collator)" /export'
$ENGINE run --user root --rm -i \
--pull always \
-v "$TMP:/export" \
--entrypoint /usr/bin/bash \
paritypr/colander:master -c \
'cp "$(which undying-collator)" /export'
./build-injected.sh $TMP
+115
View File
@@ -0,0 +1,115 @@
#!/usr/bin/env bash
#set -e
# This script allows building a Container Image from a Linux
# binary that is injected into a base-image.
ENGINE=${ENGINE:-podman}
if [ "$ENGINE" == "podman" ]; then
PODMAN_FLAGS="--format docker"
else
PODMAN_FLAGS=""
fi
CONTEXT=$(mktemp -d)
REGISTRY=${REGISTRY:-docker.io}
PEZKUWI_DEB=${PEZKUWI_DEB:-false}
# The following line ensure we know the project root
PROJECT_ROOT=${PROJECT_ROOT:-$(git rev-parse --show-toplevel)}
DOCKERFILE=${DOCKERFILE:-docker/dockerfiles/binary_injected.Dockerfile}
VERSION_TOML=$(grep "^version " $PROJECT_ROOT/Cargo.toml | grep -oE "([0-9\.]+-?[0-9]+)")
#n The following VAR have default that can be overridden
DOCKER_OWNER=${DOCKER_OWNER:-parity}
# We may get 1..n binaries, comma separated
BINARY=${BINARY:-pezkuwi}
IFS=',' read -r -a BINARIES <<< "$BINARY"
VERSION=${VERSION:-$VERSION_TOML}
ARTIFACTS_FOLDER=${ARTIFACTS_FOLDER:-.}
IMAGE=${IMAGE:-${REGISTRY}/${DOCKER_OWNER}/${BINARIES[0]}}
DESCRIPTION_DEFAULT="Injected Container image built for ${BINARY}"
DESCRIPTION=${DESCRIPTION:-$DESCRIPTION_DEFAULT}
VCS_REF=${VCS_REF:-01234567}
# Build the image
echo "Using engine: $ENGINE"
echo "Using Dockerfile: $DOCKERFILE"
echo "Using context: $CONTEXT"
echo "Building ${IMAGE}:latest container image for ${BINARY} ${VERSION} from ${ARTIFACTS_FOLDER} hang on!"
echo "ARTIFACTS_FOLDER=$ARTIFACTS_FOLDER"
echo "CONTEXT=$CONTEXT"
echo "Building image: ${IMAGE}"
TAGS=${TAGS[@]:-latest}
IFS=',' read -r -a TAG_ARRAY <<< "$TAGS"
TAG_ARGS=" "
echo "The image ${IMAGE} will be tagged with ${TAG_ARRAY[*]}"
for tag in "${TAG_ARRAY[@]}"; do
TAG_ARGS+="--tag ${IMAGE}:${tag} "
done
echo "$TAG_ARGS"
if [[ "$PEZKUWI_DEB" == true ]]; then
echo "Building pezkuwi release image based on the Debian package"
$ENGINE build \
${PODMAN_FLAGS} \
--build-arg VCS_REF="${VCS_REF}" \
--build-arg BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ') \
--build-arg PEZKUWI_VERSION=${VERSION} \
${TAG_ARGS} \
-f "${PROJECT_ROOT}/${DOCKERFILE}" \
${CONTEXT}
else
echo "Building standard image based on the binary ${BINARY[0]}"
# We need all binaries and resources available in the Container build "CONTEXT"
mkdir -p $CONTEXT/bin
for bin in "${BINARIES[@]}"
do
echo "Copying $ARTIFACTS_FOLDER/$bin to context: $CONTEXT/bin"
ls -al "$ARTIFACTS_FOLDER/$bin"
cp -r "$ARTIFACTS_FOLDER/$bin" "$CONTEXT/bin"
done
cp "$PROJECT_ROOT/docker/scripts/entrypoint.sh" "$CONTEXT"
if [[ "$BINARY" == "pezkuwi-teyrchain" ]]; then
mkdir -p "$CONTEXT/specs"
echo "Copying teyrchains chain-specs from $ARTIFACTS_FOLDER/specs to context: $CONTEXT/specs"
ls -al "$ARTIFACTS_FOLDER/specs"
cp -r "$ARTIFACTS_FOLDER/specs" "$CONTEXT/specs"
fi
# time \
$ENGINE build \
${PODMAN_FLAGS} \
--build-arg VCS_REF="${VCS_REF}" \
--build-arg BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ') \
--build-arg IMAGE_NAME="${IMAGE}" \
--build-arg BINARY="${BINARY}" \
--build-arg ARTIFACTS_FOLDER="${ARTIFACTS_FOLDER}" \
--build-arg DESCRIPTION="${DESCRIPTION}" \
${TAG_ARGS} \
-f "${PROJECT_ROOT}/${DOCKERFILE}" \
${CONTEXT}
fi
echo "Your Container image for ${IMAGE} is ready"
$ENGINE images
if [[ -z "${SKIP_IMAGE_VALIDATION}" ]]; then
echo "Check the image ${IMAGE}:${TAG_ARRAY[0]}"
$ENGINE run --rm -i "${IMAGE}:${TAG_ARRAY[0]}" --version
echo "Query binaries"
$ENGINE run --rm -i --entrypoint /bin/bash "${IMAGE}:${TAG_ARRAY[0]}" -c "echo BINARY: ${BINARY}"
fi
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=chain-spec-builder
export ARTIFACTS_FOLDER=$1
# export TAGS=...
$PROJECT_ROOT/docker/scripts/build-injected.sh
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
TMP=$(mktemp -d)
ENGINE=${ENGINE:-podman}
export TAGS=latest,beta,7777,1.0.2-rc23
# Fetch some binaries
$ENGINE run --user root --rm -i \
--pull always \
-v "$TMP:/export" \
--entrypoint /bin/bash \
parity/chain-spec-builder -c \
'cp "$(which chain-spec-builder)" /export'
echo "Checking binaries we got:"
ls -al $TMP
./build-injected.sh $TMP
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Sanity check
if [ -z "$BINARY" ]
then
echo "BINARY ENV not defined, this should never be the case. Aborting..."
exit 1
fi
# If the user built the image with multiple binaries,
# we consider the first one to be the canonical one
# To start with another binary, the user can either:
# - use the --entrypoint option
# - pass the ENV BINARY with a single binary
IFS=',' read -r -a BINARIES <<< "$BINARY"
BIN0=${BINARIES[0]}
echo "Starting binary $BIN0"
$BIN0 $@
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=malus,pezkuwi-execute-worker,pezkuwi-prepare-worker
export ARTIFACTS_FOLDER=$1
# export TAGS=...
$PROJECT_ROOT/docker/scripts/build-injected.sh
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
TMP=$(mktemp -d)
ENGINE=${ENGINE:-podman}
export TAGS=latest,beta,7777,1.0.2-rc23
# Fetch some binaries
$ENGINE run --user root --rm -i \
--pull always \
-v "$TMP:/export" \
--entrypoint /bin/bash \
paritypr/malus:7217 -c \
'cp "$(which malus)" /export'
echo "Checking binaries we got:"
ls -al $TMP
./build-injected.sh $TMP
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=pezkuwi-omni-node
export ARTIFACTS_FOLDER=$1
# export TAGS=...
$PROJECT_ROOT/docker/scripts/build-injected.sh
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=pezkuwi-teyrchain
export ARTIFACTS_FOLDER=$1
export DOCKERFILE="docker/dockerfiles/pezkuwi-teyrchain/pezkuwi-teyrchain_injected.Dockerfile"
# export TAGS=...
$PROJECT_ROOT/docker/scripts/build-injected.sh
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
TMP=$(mktemp -d)
ENGINE=${ENGINE:-podman}
export TAGS=latest,beta,7777,1.0.2-rc23
# Fetch some binaries
$ENGINE run --user root --rm -i \
--pull always \
-v "$TMP:/export" \
--entrypoint /bin/bash \
parity/pezkuwi-teyrchain:7217 -c \
'cp "$(which malus)" /export'
echo "Checking binaries we got:"
ls -al $TMP
./build-injected.sh $TMP
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
OWNER=${OWNER:-parity}
IMAGE_NAME=${IMAGE_NAME:-pezkuwi-teyrchain}
docker build --no-cache \
--build-arg IMAGE_NAME=$IMAGE_NAME \
-t $OWNER/$IMAGE_NAME \
-f ./docker/dockerfiles/pezkuwi-teyrchain/pezkuwi-teyrchain_injected.Dockerfile \
. && docker images
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=pezkuwi,pezkuwi-execute-worker,pezkuwi-prepare-worker
export DOCKERFILE="docker/dockerfiles/pezkuwi/pezkuwi_injected_debian.Dockerfile"
export PEZKUWI_DEB=true
export VERSION=$1
$PROJECT_ROOT/docker/scripts/build-injected.sh
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Sample call:
# $0 /path/to/folder_with_binary
# This script replace the former dedicated Dockerfile
# and shows how to use the generic binary_injected.dockerfile
PROJECT_ROOT=`git rev-parse --show-toplevel`
export BINARY=pezkuwi,pezkuwi-execute-worker,pezkuwi-prepare-worker
export ARTIFACTS_FOLDER=$1
export DOCKERFILE="docker/dockerfiles/pezkuwi/pezkuwi_injected.Dockerfile"
$PROJECT_ROOT/docker/scripts/build-injected.sh
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
TMP=$(mktemp -d)
ENGINE=${ENGINE:-podman}
# You need to build an injected image first
# Fetch some binaries
$ENGINE run --user root --rm -i \
-v "$TMP:/export" \
--entrypoint /bin/bash \
parity/pezkuwi -c \
'cp "$(which pezkuwi)" /export'
echo "Checking binaries we got:"
tree $TMP
./build-injected.sh $TMP