Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

Commit

Permalink
Work around docker rm errors
Browse files Browse the repository at this point in the history
This is a hopefully temporary work around this issue:
moby/moby#9665

This means that docker rm is unreliable.  All we really care about when
we stop the service is to ensure that the service is stopped, so we
explicitly ask docker for that via inspect instead of relying on the rm
result code.
  • Loading branch information
Clayton O'Neill committed Feb 15, 2016
1 parent d10bc3d commit 7aeaf3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/etc/init.d/docker-run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ stop() {
<% if @remove_container_on_stop -%>
$docker rm <% if @remove_volume_on_stop %>-v<% end %> <%= @sanitised_title %>
<% end -%>
return $?

if [ "true" = "$(docker inspect -f '{{.State.Running}}' <%= @sanitised_title %> 2>/dev/null)" ]; then
return 1
fi
return 0
}

clean() {
Expand Down

0 comments on commit 7aeaf3b

Please sign in to comment.