2018-08-24 05:55:54 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# The image name
|
|
|
|
PARITY_IMAGE_REPO=${PARITY_IMAGE_REPO:-parity/parity}
|
|
|
|
# The tag to be used for builder image
|
|
|
|
PARITY_BUILDER_IMAGE_TAG=${PARITY_BUILDER_IMAGE_TAG:-build}
|
|
|
|
# The tag to be used for runner image
|
|
|
|
PARITY_RUNNER_IMAGE_TAG=${PARITY_RUNNER_IMAGE_TAG:-latest}
|
|
|
|
|
|
|
|
echo Building $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
2019-10-31 14:59:51 +01:00
|
|
|
docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f scripts/docker/centos/Dockerfile.build
|
2018-08-24 05:55:54 +02:00
|
|
|
|
|
|
|
echo Creating $PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary
|
|
|
|
docker create --name extract $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
2019-10-31 14:59:51 +01:00
|
|
|
mkdir scripts/docker/centos/parity
|
|
|
|
docker cp extract:/build/parity-ethereum/target/release/parity scripts/docker/centos/parity
|
2018-08-24 05:55:54 +02:00
|
|
|
|
|
|
|
echo Building $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG
|
2019-10-31 14:59:51 +01:00
|
|
|
docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG scripts/docker/centos/ -f scripts/docker/centos/Dockerfile
|
2018-08-24 05:55:54 +02:00
|
|
|
|
|
|
|
echo Cleaning up ...
|
2019-10-31 14:59:51 +01:00
|
|
|
rm -rf scripts/docker/centos/parity
|
2018-08-24 05:55:54 +02:00
|
|
|
docker rm -f extract
|
|
|
|
docker rmi -f $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
|
|
|
|
|
|
|
echo Echoing Parity version:
|
|
|
|
docker run $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG --version
|
|
|
|
|
|
|
|
echo Done.
|