Skip to content
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

Can't remove container if it fails to start using ContainerCollection.run() #3284

Open
gringolito opened this issue Sep 12, 2024 · 1 comment

Comments

@gringolito
Copy link

I'm using the ContainerCollection.run() method to run containers with the SDK but when the container fails to start (due to wrong parameters or misconfiguration on the Docker Desktop) I can't remove the dangling container since it is not returned to the user when the container.start() call raises an APIError nor is removed if I set the remove flag to True.

container.start()

I would be able to have this container removed if I set the remove flag to True and/or have the container reference returned to the user, enclosed within an exception might be an option.

$ pip freeze | grep docker && python --version && docker version
docker==7.0.0
Python 3.10.14
Client:
 Version:           27.2.0
 API version:       1.47
 Go version:        go1.21.13
 Git commit:        3ab4256
 Built:             Tue Aug 27 14:14:45 2024
 OS/Arch:           darwin/amd64
 Context:           default

Server: Docker Desktop 4.34.0 (165256)
 Engine:
  Version:          27.2.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.21.13
  Git commit:       3ab5c7d
  Built:            Tue Aug 27 14:15:15 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.20
  GitCommit:        8fc6bcff51318944179630522a095cc9dbf9f353
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@gringolito
Copy link
Author

A solution is proposed in #3285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant