#! /bin/sh set -e ci_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")" script_dir="$(dirname "$ci_dir")" src_dir="$(dirname "$script_dir")" cd "$src_dir" . "$script_dir"/version.sh export build_dir=${build_dir:-_docker_build} tmp_dir=$(mktemp -dt tezos.opam.tezos.XXXXXXXX) 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 "$tmp_dir" if ! [ -z "$container" ]; then docker rm $container; fi } trap cleanup EXIT INT "$ci_dir"/create_apk.hidapi.sh cp -a "$build_dir"/hidapi-$hidapi_version-r0.apk \ "$build_dir"/keys/ \ "$tmp_dir" mkdir -p "$tmp_dir"/bin mkdir -p "$tmp_dir"/scripts container=$(docker create $build_image_name) for bin in tezos-client tezos-admin-client tezos-node \ tezos-alpha-baker tezos-alpha-endorser tezos-alpha-accuser; do docker cp -L $container:/home/opam/tezos/$bin "$tmp_dir"/bin done cp -a "$script_dir"/docker/entrypoint.sh "$tmp_dir"/bin/ cp -a "$script_dir"/docker/entrypoint.inc.sh "$tmp_dir"/bin/ cp "$script_dir"/alphanet.sh "$tmp_dir"/scripts/ cp "$script_dir"/alphanet_version "$tmp_dir"/scripts/ cp "$src_dir"/src/bin_client/bash-completion.sh "$tmp_dir"/scripts/ echo echo "### Building minimal docker image..." echo cat > "$tmp_dir"/Dockerfile <