Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
chore: refresh of the builder image + build script
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Sep 29, 2021
1 parent d82486a commit 0db9b22
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 30 deletions.
8 changes: 3 additions & 5 deletions scripts/dockerfiles/polkadot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ PROJECT_ROOT=`git rev-parse --show-toplevel`
cd $PROJECT_ROOT

# Find the current version from Cargo.toml
VERSION=`grep "^version" ./Cargo.toml | egrep -o "([0-9\.]+)"`
VERSION=`grep "^version" ./cli//Cargo.toml | egrep -o "([0-9\.]+)"`
GITUSER=parity
GITREPO=polkadot

# Build the image
echo "Building ${GITUSER}/${GITREPO}:latest docker image, hang on!"
time docker build -f ./scripts/docker/polkadot/polkadot_builder.Dockerfile --build-arg RUSTC_WRAPPER= --build-arg PROFILE=release -t ${GITUSER}/${GITREPO}:latest .
time docker build -f ./scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile -t ${GITUSER}/${GITREPO}:latest .
docker tag ${GITUSER}/${GITREPO}:latest ${GITUSER}/${GITREPO}:v${VERSION}

# Show the list of available images for this repo
echo "Image is ready"
docker images | grep ${GITREPO}

echo -e "\nIf you just built version ${VERSION}, you may want to update your tag:"
echo " $ docker tag ${GITUSER}/${GITREPO}:$VERSION ${GITUSER}/${GITREPO}:${VERSION}"

popd
30 changes: 16 additions & 14 deletions scripts/dockerfiles/polkadot/docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
version: '3'
services:
node_alice:
build:
context: .
dockerfile: polkadot_builder.Dockerfile
ports:
- "30333:30333"
- "9933:9933"
- "9944:9944"
- "9615:9615"
image: chevdor/polkadot:latest
image: parity/polkadot:latest
volumes:
- "polkadot-data-alice:/data"
command: polkadot --chain=polkadot-local --alice -d /data --node-key 0000000000000000000000000000000000000000000000000000000000000001
command: |
--chain=polkadot-local
--alice
-d /data
--node-key 0000000000000000000000000000000000000000000000000000000000000001
networks:
testing_net:
ipv4_address: 172.28.1.1

node_bob:
build:
context: .
dockerfile: polkadot_builder.Dockerfile
ports:
- "30344:30344"
- "9935:9935"
- "9945:9945"
- "9615:9615"
image: chevdor/polkadot:latest
- "30344:30343"
- "9935:9933"
- "9945:9944"
- "29615:9615"
image: parity/polkadot:latest
volumes:
- "polkadot-data-bob:/data"
links:
- "node_alice:alice"
command: polkadot --chain=polkadot-local --bob -d /data --port 30344 --rpc-port 9935 --ws-port 9945 --bootnodes '/ip4/172.28.1.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR'
command: |
--chain=polkadot-local
--bob
-d /data
--bootnodes '/ip4/172.28.1.1/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR'
networks:
testing_net:
ipv4_address: 172.28.1.2
Expand Down
17 changes: 12 additions & 5 deletions scripts/dockerfiles/polkadot/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
version: '3'
services:
polkadot:
build:
context: .
dockerfile: polkadot_builder.Dockerfile
ports:
- "127.0.0.1:30333:30333/tcp"
- "127.0.0.1:9933:9933/tcp"
image: chevdor/polkadot:latest
image: parity/polkadot:latest
volumes:
- "polkadot-data:/data"
command: polkadot
command: |
--unsafe-rpc-external
--unsafe-ws-external
--rpc-cors all
--prometheus-external
ports:
- "30333:30333"
- "9933:9933"
- "9944:9944"
- "9615:9615"

volumes:
polkadot-data:
8 changes: 2 additions & 6 deletions scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
FROM docker.io/paritytech/ci-linux:production as builder

WORKDIR /polkadot

COPY . /polkadot

RUN cargo build --locked --release
# RUN mkdir -p /polkadot/target/release/ && \
# echo "#!/usr/bin/bash\nprintf 'Hello'\n" > /polkadot/target/release/polkadot && \
# chmod +x /polkadot/target/release/polkadot

# This is the 2nd stage: a very small image where we copy the Polkadot binary."
FROM docker.io/library/ubuntu:20.04

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.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/paritytech/polkadot/blob/${VCS_REF}/docker/Dockerfile" \
Expand Down

0 comments on commit 0db9b22

Please sign in to comment.