1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/cpp/docker.sh
Stephen Thirlwall 9ddaa0b91b c++11: step 0
2015-03-27 20:44:42 +11:00

35 lines
470 B
Bash
Executable File

#!/bin/bash
IMAGE_NAME=mal-cpp
CONTAINER_NAME=mal-cpp-running
run() {
docker rm -f $CONTAINER_NAME > /dev/null 2>/dev/null
docker run -v $PWD:/mal -ti --name $CONTAINER_NAME $IMAGE_NAME "$@"
}
case $1 in
build)
docker build -t $IMAGE_NAME .
;;
run)
shift
run "$@"
;;
make)
shift
run make "$@"
;;
*)
echo "usage: $0 [build|run|make]"
exit 1
;;
esac