work around 'docker rm -f' weirdness

I've been seeing

~# docker rm -f weave
Error response from daemon: Cannot destroy container weave: Driver devicemapper failed to remove root filesystem 29e46c3e400ee3c8654f2b06a0f6d97bde98dfeb9bb61d25195dba38c04324fc: Device is Busy

whereas the corresponding two-step 'docker kill' + 'docker rm' works
fine.
This commit is contained in:
Matthias Radestock committed 2014-09-13 07:51:06 +01:00
1 parent 51afd5e9c6
commit 1fac995248
1 file changed
+2 -1
+2 -1
View File
@@ -152,9 +152,10 @@ case "$COMMAND" in
exit 0
;;
stop)
if ! docker rm -f weave >/dev/null 2>&1 ; then
if ! docker kill weave >/dev/null 2>&1 ; then
echo "Weave is not running."
fi
docker rm -f weave >/dev/null 2>&1 || true
if command_exists conntrack
then
conntrack -D -p udp --dport 6783 >/dev/null 2>&1