2022-12-07 18:38:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Usage: default-build.sh <image-tag> [<repo-relative-path>]
|
|
|
|
# if <repo-relative-path> is not supplied, the context is the directory where the Dockerfile lives
|
2023-02-20 23:16:15 +00:00
|
|
|
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2022-12-07 18:38:32 +00:00
|
|
|
if [[ $# -ne 2 ]]; then
|
|
|
|
echo "Illegal number of parameters" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
image_tag=$1
|
|
|
|
build_dir=$2
|
|
|
|
echo "Building ${image_tag} in ${build_dir}"
|
2023-02-25 05:26:02 +00:00
|
|
|
docker build -t ${image_tag} --build-arg CERC_HOST_UID=${CERC_HOST_UID} --build-arg CERC_HOST_GID=${CERC_HOST_GID} ${build_dir}
|