Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env sh
containerName=${NAME}
containerTag=latest
containerLabel="$containerName:$containerTag"
if [ "_$1" = "_clean" ]; then
docker stop $containerName
docker rm -v $containerName
exit 0
fi
if [ "_$1" = "_cleani" ]; then
docker stop $containerName
docker rm -v $containerName
docker rmi "$containerLabel"
exit 0
fi
docker build -t $containerLabel .
docker run -itd \
-v $(pwd)/build:/root/app \
--name=$containerName \
-p 8080:8080 \
--restart=always \
$containerLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.