Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MPJHorner/7bbdb803324da77d88ee656aae3d2a5d to your computer and use it in GitHub Desktop.
Save MPJHorner/7bbdb803324da77d88ee656aae3d2a5d to your computer and use it in GitHub Desktop.
#In this example 'phpfpm-demo' is the name of the image, you need to run this as a 'sh' script in the directory where the Dockerfile is located.
docker ps -a | awk '{ print $1,$2 }' | grep phpfpm-demo | awk '{print $1 }' | xargs -I {} docker rm {}
docker rmi phpfpm-demo
docker build -t phpfpm-demo .
docker run -p 9000:9000 phpfpm-demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment