You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remove: Delete container when the container's processes exit. Default: False.
>>> import podman
>>> podman.__version__
'5.0.0'
>>> c = client.containers.run("myimage", detach=True, remove=True, command="/bin/false")
>>> c.status
'exited'
26034e386c92 myimage /bin/false 14 seconds ago Exited (1) 14 seconds ago interesting_williamson
The text was updated successfully, but these errors were encountered:
landgraf
changed the title
remove option of containers.run doesn't have any effect
Container is not deleted if remove=True specified
Jun 24, 2024
inknos
changed the title
Container is not deleted if remove=True specified
Container is not deleted if detach=True and remove=True are specified
Jul 29, 2024
from podman import PodmanClient
uri = "unix:///run/user/1000/podman/podman.sock"
with PodmanClient(base_url=uri) as client:
c = client.containers.run("nginx", remove=True, command="/bin/false")
print(c.status)
while
from podman import PodmanClient
uri = "unix:///run/user/1000/podman/podman.sock"
with PodmanClient(base_url=uri) as client:
c = client.containers.run("nginx", deatch=True, remove=True, command="/bin/false")
print(c.status)
Ok, the problem is just that detach is called before remove. I can see how the options can live together, but since I would avoid delegating the removal to the user or threading/scheduling the removal.
Maybe @jwhonce might have something to add about the reasoning behind the code, or if there were some thoughts already on this detach/remove process.
The text was updated successfully, but these errors were encountered: