Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@douglampe
Last active August 12, 2017 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglampe/440c3b5b6ce3cf8386e21f3a02651962 to your computer and use it in GitHub Desktop.
Save douglampe/440c3b5b6ce3cf8386e21f3a02651962 to your computer and use it in GitHub Desktop.
Bash script to rebuild and run docker image from content in ~/app/publish.tar.gz
# Note: Assumes dockerfile is in ~/app and content is in ~/app/publish.tar.gz
proj=$1
cd ~/app
docker rm $(docker stop $(docker ps -a -q --filter ancestor=$proj --format="{{.ID}}"))
rm -rf publish
tar -xvzf publish.tar.gz
docker build -t $proj .
docker run -d -p 80:5000 $proj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment