2018-08-24 05:55:54 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# The image name
|
2020-03-25 17:16:51 +01:00
|
|
|
OPENETHEREUM_IMAGE_REPO=${OPENETHEREUM_IMAGE_REPO:-openethereum/openethereum}
|
2018-08-24 05:55:54 +02:00
|
|
|
# The tag to be used for builder image
|
2020-03-25 17:16:51 +01:00
|
|
|
OPENETHEREUM_BUILDER_IMAGE_TAG=${OPENETHEREUM_BUILDER_IMAGE_TAG:-build}
|
2018-08-24 05:55:54 +02:00
|
|
|
# The tag to be used for runner image
|
2020-03-25 17:16:51 +01:00
|
|
|
OPENETHEREUM_RUNNER_IMAGE_TAG=${OPENETHEREUM_RUNNER_IMAGE_TAG:-latest}
|
2018-08-24 05:55:54 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
echo Building $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
|
|
|
docker build --no-cache -t $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f scripts/docker/centos/Dockerfile.build
|
2018-08-24 05:55:54 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
echo Creating $OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary
|
|
|
|
docker create --name extract $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
|
|
|
mkdir scripts/docker/centos/openethereum
|
|
|
|
docker cp extract:/build/openethereum/target/release/openethereum scripts/docker/centos/openethereum
|
2018-08-24 05:55:54 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
echo Building $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG
|
|
|
|
docker build --no-cache -t $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG scripts/docker/centos/ -f scripts/docker/centos/Dockerfile
|
2018-08-24 05:55:54 +02:00
|
|
|
|
|
|
|
echo Cleaning up ...
|
2020-03-25 17:16:51 +01:00
|
|
|
rm -rf scripts/docker/centos/openethereum
|
2018-08-24 05:55:54 +02:00
|
|
|
docker rm -f extract
|
2020-03-25 17:16:51 +01:00
|
|
|
docker rmi -f $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
|
2018-08-24 05:55:54 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
echo Echoing OpenEthereum version:
|
|
|
|
docker run $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG --version
|
2018-08-24 05:55:54 +02:00
|
|
|
|
|
|
|
echo Done.
|