-
Notifications
You must be signed in to change notification settings - Fork 611
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
Detaching from a container started with run --rm
unexpectedly stops and removes it
#3568
Labels
bug
Something isn't working
Comments
@AkihiroSuda do you have insight on "what" is deleting the container in that case? |
AkihiroSuda
added
bug
Something isn't working
and removed
kind/unconfirmed-bug-claim
Unconfirmed bug claim
labels
Oct 18, 2024
Likely to be a bug in nerdctl |
Hi, team I'd like to work on this issue, so could you assing to me? |
haytok
added a commit
to haytok/nerdctl
that referenced
this issue
Oct 30, 2024
In the current implementation, detaching from a container started with `nerdctl run --rm ...` unexpectedly removes it. The behaviour before this modification is as follows. ``` > nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine / # INFO[0002] read detach keys > nerdctl ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ``` When the same operaton is performed in the Docker CLI, the container will not be deleted. This issue is reported in the following: - containerd#3568 Therefore, this commit resolves this behaviour of a container not being deleted on detachment. Note that the behaviour after this modification is as follows. ``` > nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine / # INFO[0010] read detach keys > nerdctl ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 46f4c829e5cc docker.io/library/alpine:latest "/bin/sh" 15 seconds ago Up test ``` Signed-off-by: Hayato Kiwata <[email protected]>
haytok
added a commit
to haytok/nerdctl
that referenced
this issue
Nov 4, 2024
In the current implementation, detaching from a container started with `nerdctl run --rm ...` unexpectedly removes it. The behaviour before this modification is as follows. ``` > nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine / # INFO[0002] read detach keys > nerdctl ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ``` When the same operation is performed in the Docker CLI, the container will not be deleted. This issue is reported in the following: - containerd#3568 Therefore, this commit resolves this behaviour of a container not being deleted on detachment. Note that the behaviour after this modification is as follows. ``` > nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine / # INFO[0010] read detach keys > nerdctl ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 46f4c829e5cc docker.io/library/alpine:latest "/bin/sh" 15 seconds ago Up test ``` This PR has also been modified to remove a container when detaching and attaching a container started with the --rm option. The detailed behaviour is as follows. ``` > nerdctl attach test / # exit > nerdctl ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ``` Signed-off-by: Hayato Kiwata <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Compare with docker behavior.
Note that this does not happen if there is no
--rm
.Steps to reproduce the issue
No response
Describe the results you received and expected
na
What version of nerdctl are you using?
main
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
No response
The text was updated successfully, but these errors were encountered: