This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
build.sh
executable file
·29 lines (22 loc) · 1.43 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env sh
# The image name
OPENETHEREUM_IMAGE_REPO=${OPENETHEREUM_IMAGE_REPO:-openethereum/openethereum}
# The tag to be used for builder image
OPENETHEREUM_BUILDER_IMAGE_TAG=${OPENETHEREUM_BUILDER_IMAGE_TAG:-build}
# The tag to be used for runner image
OPENETHEREUM_RUNNER_IMAGE_TAG=${OPENETHEREUM_RUNNER_IMAGE_TAG:-latest}
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
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
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 ...
rm -rf scripts/docker/centos/openethereum
docker rm -f extract
docker rmi -f $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_BUILDER_IMAGE_TAG-$(git log -1 --format="%H")
echo Echoing OpenEthereum version:
docker run $OPENETHEREUM_IMAGE_REPO:$OPENETHEREUM_RUNNER_IMAGE_TAG --version
echo Done.