fussybeaver / bollard

Docker daemon API in Rust
Apache License 2.0
911 stars 134 forks source link

What would be the equivalent of docker run --rm? #456

Open soucosmo opened 3 months ago

soucosmo commented 3 months ago

I need to create the container and start it right away, and when the internal task is finished executing, the container should be automatically deleted, I get this behavior using docker run --rm.

fussybeaver commented 3 months ago

There should be an "autoremove" field on the HostConfig that you provide when creating the container.