Created
January 8, 2019 06:17
-
-
Save miyako-ep/eea082a310a440e24d7f0ac6f150e85c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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