Created
March 10, 2015 01:32
-
-
Save diablowu/ec3bbb31c67ff80f4a69 to your computer and use it in GitHub Desktop.
remove a container of tomcat
This file contains hidden or 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 | |
| boxid=$1 | |
| datadir="/data/$boxid" | |
| cntid=`docker ps -a|grep $boxid|awk '{print $1}'` | |
| cntip=`docker inspect --format='{{.NetworkSettings.IPAddress}}' $cntid` | |
| #clear iptables nat | |
| ./rmnat.sh $cntip 8080 | |
| #force to remove container | |
| docker rm -f $cntid | |
| #clean workspace | |
| echo "$datadir will be clean" | |
| rm -rf $datadir | |
| echo $cntid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment