Hi,
I am trying to start a container, get a particular file and delete the container again,
but I always get this error: "Conflict, cannot remove the default name of the container"
Newest Docker-py Version, running on Windows
Code:
container = client.containers.run("busybox:latest, "echo test", detach=True)
client.api.wait(container.id)
try:
pass # in reality rip a file from the container
finally:
client.api.remove_container(container .id, True, True) # ERROR
Thx!
In your call to remove_container, you're setting link=True, which is probably not what you're looking to do.
link (bool): Remove the specified link and not the underlying
container
Try container.remove(v=True, force=True) instead.
Most helpful comment
In your call to
remove_container, you're settinglink=True, which is probably not what you're looking to do.Try
container.remove(v=True, force=True)instead.