Skip to content

Instantly share code, notes, and snippets.

@fuxingloh
Created April 27, 2016 17:27
Show Gist options
  • Select an option

  • Save fuxingloh/2224f568975a9e0760c9cafa909cb35e to your computer and use it in GitHub Desktop.

Select an option

Save fuxingloh/2224f568975a9e0760c9cafa909cb35e to your computer and use it in GitHub Desktop.
Docker Rebuild with stop, rm, rmi build and run
#!/usr/bin/env bash
# Use it like this ./docker-rebuild.sh name 80:80
#chmod +x rebuild.sh
#./rebuild.sh
NAME=$1
PORT=$2
# Clean and Remove all
docker stop $NAME
docker rm $NAME
docker rmi $NAME
# Build and Run
docker build -t $NAME .
docker run -d -p $2 --name $NAME $NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment