#!/usr/bin/env bash

set -eu

if [ $# -ne 0 ]; then
    echo "no arguments allowed for ${0##*/}, given: $*" >&2
    exit 64
fi

bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )

# shellcheck source=_docker.sh
. "$bindir"/_docker.sh
# shellcheck source=_tag.sh
. "$bindir"/_tag.sh
# shellcheck source=_os.sh
. "$bindir"/_os.sh

dir=$( cd "$bindir"/../policy-controller && pwd )
docker_build policy-controller "${TAG:-$(head_root_tag)}" "$dir/Dockerfile"
