Skip to content

Instantly share code, notes, and snippets.

@diablowu
Created March 10, 2015 01:32
Show Gist options
  • Select an option

  • Save diablowu/ec3bbb31c67ff80f4a69 to your computer and use it in GitHub Desktop.

Select an option

Save diablowu/ec3bbb31c67ff80f4a69 to your computer and use it in GitHub Desktop.
remove a container of tomcat
#!/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