Last active
August 29, 2015 14:09
-
-
Save jotson/87c1bba650024bd8512b to your computer and use it in GitHub Desktop.
Bash script to start dev container and cleanup after
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
#!/bin/bash | |
# Start a container | |
# jotson/webdev runs supervisord so this command waits until Ctrl+C | |
sudo docker run -p 80:80 jotson/webdev $* | |
# Delete container | |
echo "Cleaning up container..." | |
sudo docker rm $(sudo docker ps -a | grep 'webdev.*Exited.*second.*ago' | awk '{ print $1 }') | |
echo "Webdev finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment