openethereum/scripts/docker/centos/build.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env sh
# The image name
2020-09-22 14:53:52 +02:00
OPENETHEREUM_IMAGE_REPO=${OPENETHEREUM_IMAGE_REPO:-openethereum/openethereum}
# The tag to be used for builder image
2020-09-22 14:53:52 +02:00
OPENETHEREUM_BUILDER_IMAGE_TAG=${OPENETHEREUM_BUILDER_IMAGE_TAG:-build}
# The tag to be used for runner image
2020-09-22 14:53:52 +02:00
OPENETHEREUM_RUNNER_IMAGE_TAG=${OPENETHEREUM_RUNNER_IMAGE_TAG:-latest}
2020-09-22 14:53:52 +02: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
2020-09-22 14:53:52 +02: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
2020-09-22 14:53:52 +02: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
echo Cleaning up ...
2020-09-22 14:53:52 +02:00
rm -rf scripts/docker/centos/openethereum
docker rm -f extract
2020-09-22 14:53:52 +02:00
docker rmi -f $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
2020-09-22 14:53:52 +02:00
echo Echoing OpenEthereum version:
docker run $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG --version
echo Done.