ligo/scripts/create_docker_image.build.sh

35 lines
653 B
Bash
Raw Normal View History

2017-08-04 20:32:52 +04:00
#! /bin/sh
set -e
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")"
cd "$src_dir"
. scripts/version.sh
image_name="${1:-tezos_build}"
image_version="${2:-latest}"
build_deps_image_name="${3-${image_name}_deps:${image_version}}"
cleanup () {
set +e
echo Cleaning up...
rm -rf Dockerfile
}
trap cleanup EXIT INT
2017-08-22 16:09:21 +04:00
sed -e 's|$base_image|'"$build_deps_image_name"'|g' \
scripts/Dockerfile.build.in > Dockerfile
2017-08-04 20:32:52 +04:00
echo
echo "### Building tezos..."
echo
docker build -t "$image_name:$image_version" .
rm Dockerfile
echo
echo "### Succesfully build docker image: $image_name:$image_version"
echo