-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rm --rm and -d #10545
Comments
This might be helpful for #7245 as well (at least for the |
Why not just ignore the error? |
That's what I'm currently doing, but docker can fail for plenty of reasons that I don't want to ignore (an obvious example is a failure to connect to |
closing as a duplicate of #6757 |
@jfrazelle I don't think this is a duplicate. In fact, I've since stopped using |
I reopened |
Thanks :) |
Can you put the need for |
Dang phone closed it... Anyway... Was thinking about a restart policy called "remove", wdyt? |
Updated description to de-emphasize the relevance of @cpuguy83 is that so that you could have a reliable alternative to I think the explicit |
I've been looking at the various Issue 1: Issue 2: server-side deletion can fail, leaving a mix of invalid state or content (leftover filesystem pieces, mounts, etc.). I think the "right" fix for issue 1 that @duglin and I have both mentioned in various arenas is to make Issue 2 has no "perfect fix" but can be mitigated by more robust deletion logic that tries as much as possible to perform the delete, handling errors as necessary or where feasible. @crosbymichael made this clear in the recent PR #10099 closure (#10099 (comment)) Pinging @jfrazelle @duglin and @tibor as I know this was discussed on IRC earlier but I wasn't around to give my 2c :) |
...and maybe I should have added this comment to the other not-really-a-dup issue given @gfxmonk made it clear he is looking for "ignore-errors" flag to |
Haha yes no worries about placement but I agree with you on all the above On Tuesday, February 10, 2015, Phil Estes notifications@github.com wrote:
|
That would be a convenient feature (and I'd use it), but unless it's completely impossible for |
Just to pull threads together, there's also: #10688 |
See PR #13855 |
|
Implemented in #20848 (Docker 1.13 and up) |
It 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").-f
would fit withrm
, 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).Rationale:
docker run --rm
, for various reasons, is not always reliable - a common workaround is to rundocker rm <container>
before I rundocker run --rm <container>
, to ensure that a previous unclean exit doesn't prevent me from starting a container with the same name.--rm
, and are just using well-known container names, you often have reason to "remove container if it exists, ignore otherwise". e.g when using--detached
you can't use--rm
anyway, so you need to perform manual cleanup of stopped containers at some point. Most methods of scripting this are racey, which is why I thinkrm
should handle it internally.The text was updated successfully, but these errors were encountered: