ligo/scripts/create_docker_image.minimal.sh

39 lines
837 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}"
image_version="${2:-latest}"
build_image_name="${3:-${image_name}_build:${image_version}}"
cleanup () {
set +e
echo Cleaning up...
rm -rf Dockerfile bin
}
trap cleanup EXIT INT
docker run -dit --rm --volume $(pwd)/bin:/home/opam/bin "$build_image_name" \
/bin/sh -c "sudo cp -L /home/opam/tezos/_build/install/default/bin/* /home/opam/bin"
2017-08-04 20:32:52 +04:00
ls bin
2017-08-04 20:32:52 +04:00
echo
echo "### Building minimal docker image..."
echo
2017-08-22 16:09:21 +04:00
sed -e 's|$alpine_version|'"$alpine_version"'|g' \
scripts/Dockerfile.minimal.in > Dockerfile
2017-08-04 20:32:52 +04:00
docker build -t "$image_name:$image_version" .
echo
echo "### Succesfully build docker image: $image_name:$image_version"
echo
rm -r bin