stud/IV/in-container
2021-05-09 17:03:40 +03:00

16 lines
351 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
NAME=wm-mj-build
if [[ -z "$(docker images -q --filter "reference=$NAME")" ]]; then
docker build -t "$NAME" - < Dockerfile
fi
exec docker run -ti --rm \
--net=host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(git rev-parse --show-toplevel):/x \
-w /x/$(basename ${PWD}) \
"$NAME" "$@"