{"action":"reopened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/10545","labels_url":"https://api.github.com/repos/docker/docker/issues/10545/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/10545/comments","events_url":"https://api.github.com/repos/docker/docker/issues/10545/events","html_url":"https://github.com/docker/docker/issues/10545","id":56474056,"number":10545,"title":"idempotent rm","user":{"login":"gfxmonk","id":14172,"avatar_url":"https://avatars.githubusercontent.com/u/14172?v=3","gravatar_id":"","url":"https://api.github.com/users/gfxmonk","html_url":"https://github.com/gfxmonk","followers_url":"https://api.github.com/users/gfxmonk/followers","following_url":"https://api.github.com/users/gfxmonk/following{/other_user}","gists_url":"https://api.github.com/users/gfxmonk/gists{/gist_id}","starred_url":"https://api.github.com/users/gfxmonk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfxmonk/subscriptions","organizations_url":"https://api.github.com/users/gfxmonk/orgs","repos_url":"https://api.github.com/users/gfxmonk/repos","events_url":"https://api.github.com/users/gfxmonk/events{/privacy}","received_events_url":"https://api.github.com/users/gfxmonk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-04T03:09:18Z","updated_at":"2015-02-10T21:41:58Z","closed_at":null,"body":"`docker run --rm`, for various reasons, is not reliable - if there's an error in docker, or if the process is killed abnormally, I often end up with the container not actually being removed. I suspect there's nothing you can do to make `--rm` truly reliable for catastrophic events (like power loss).\r\n\r\nMy workaround is to run `docker rm <container>` before I run `docker run --rm <container>`, to ensure that a previous unclean exit doesn't prevent me from starting a container with the same name.\r\n\r\nIt would be good if I could supply a flag to `docker rm` to signal that I don't care if the container doesn't exist, rather than have it fail (and then parsing the error message to make sure it failed with \"No such container\").\r\n\r\n`-f` would fit with `rm`, but it's not exactly forcing anything - perhaps something more explicit like `--ignore-missing` would be better (and may be applicable to more commands in the future)."}}