Files
evm/scripts/build_image.sh
T
66c57ca626 Fix Dockerfile and add Build Image to GH Actions (#561)
* Remove specified git version to avoid downgrades breaking docker build

* Add build docker image to unit test action

* Update to use current branch instead of commit for docker image build

* Update docker image script to push image if env var is set

* Add new line to build image script

* Update scripts/constants.sh

Co-authored-by: Sam Batschelet <[email protected]>

* Update docker login

* Update build image action

* Update gh action

* checkout for docker image build

* Set build image ID in gh action with github.ref_name

* Separate CI and release

* remove extra copy

* Update name

* Update variable used in build image id

* Update set var

* Update dockerhub repo

* Revert dockerhub repo name chnge and use Subnet-EVM in tag name

---------

Co-authored-by: Sam Batschelet <[email protected]>
2023-03-09 13:44:17 -05:00

25 lines
760 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Avalanche root directory
SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Load the versions
source "$SUBNET_EVM_PATH"/scripts/versions.sh
# Load the constants
source "$SUBNET_EVM_PATH"/scripts/constants.sh
echo "Building Docker Image: $DOCKERHUB_REPO:$BUILD_IMAGE_ID based of $AVALANCHEGO_VERSION"
docker build -t "$DOCKERHUB_REPO:$BUILD_IMAGE_ID" "$SUBNET_EVM_PATH" -f "$SUBNET_EVM_PATH/Dockerfile" \
--build-arg AVALANCHE_VERSION="$AVALANCHEGO_VERSION" \
--build-arg SUBNET_EVM_COMMIT="$SUBNET_EVM_COMMIT" \
--build-arg CURRENT_BRANCH="$CURRENT_BRANCH"
if [[ ${PUSH_DOCKER_IMAGE:-""} == "true" ]]; then
docker push $DOCKERHUB_REPO:$BUILD_IMAGE_ID
fi