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 does not work with -d #6003
Comments
This feature has been discussed before and there were multiple reasons why it didn't get added, including technical ones. This might be added at some point after 1.0, but not before. |
Ok, time scale seems fair, but can this be left open with a milestone of "later" or something? |
Ping @unclejack ? It's now after 1.0 - even if this issue remains closed it would be nice to know what the multiple reasons are (so I don't waste my time with a PR if it's just going to get rejected). |
@aidanhs We haven't forgotten about this, it's just that implementing this right now would be quite hacky. I've looked into this myself and the code wouldn't end up looking so pretty. |
You should be able to use --rm with -d. I think this should be reopened. |
Why is this still closed? |
Please consider re-opening of this issue. |
I got "-d with -rm" working at the shell script level. If anyone is interested then this is what I came up with: #!/bin/bash
# Start docker without -rm and we'll get it removed after exit.
PID=$(docker run -d "$@")
[ -z "$PID" ] && echo "Container failed to start!" && exit 1 || (docker wait $PID && docker rm $PID)& |
Has anyone come across a more elegant solution to getting around this issue? Is there any new discussion on getting something like this officially supported? Seeing that other instances of this question point here, it would be nice to mention them if so. |
you should checkout #10545 |
I can't believe this is still not possible. I'm trying to love docker, but it just feels so hacky, like it leaking disk space by never cleaning anything up, or having some weird latest tag convention that makes no sense what so ever. |
@Aidenir |
Original PR: #1589
Justification:
It's currently supported only when -d isn't provided. It doesn't make sense to automatically remove a container created via
docker run -d
. There are two reasons why this is implemented this way: 1) we might want to retrieve some kind of exit status or logs before removing the container 2) making this run on the server side is difficult in the current architecture.I want to be able to do this, so 1 doesn't apply. I don't think it being difficult is a good reason for this restriction if it's actually wanted.
Hence opening this issue.
The text was updated successfully, but these errors were encountered: