IMAGE := ultrasound
ROOT := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST})))

DOCKER_PARAMETERS := \
	--user $(shell id -u) \
	--gpus all \
	-v ${ROOT}:/app \
	-w /app \
	-e HOME=/tmp

init:
	docker build -t ${IMAGE} .


run_module: .require-module
	docker run -it --rm ${DOCKER_PARAMETERS} \
		${IMAGE} ${module}

bash_docker:
	docker run -it --rm ${DOCKER_PARAMETERS} ${IMAGE}

.require-module:
ifndef module
	$(error module is required)
endif
