stud/IV/in-container

16 lines
306 B
Plaintext
Raw Normal View History

2021-05-09 16:51:54 +03:00
#!/bin/bash
set -euo pipefail
NAME=wm-mj-build
if [[ -z "$(docker images -q --filter "reference=$NAME")" ]]; then
docker build -t "$NAME" - < Dockerfile
fi
2021-05-09 16:58:17 +03:00
exec docker run -ti --rm \
--net=host \
2021-05-09 16:51:54 +03:00
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/x \
-w /x \
"$NAME" "$@"