#!/usr/bin/env bash
set -euf -o pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
NTHREADS="$(python -c 'import psutil; print(psutil.cpu_count(logical=False))')"

docker build --rm=true --build-arg "NTHREADS=$NTHREADS" "$@" -t 'keckj/hysop:bionic' -f "${SCRIPT_DIR}/../docker_images/ubuntu/bionic/Dockerfile" "${SCRIPT_DIR}/.."
