AgustinCB / docker-api

Docker Remote API driver for node.js. It uses the same modem than dockerode, but the interface is promisified and with a fancier syntax.
GNU General Public License v3.0
303 stars 51 forks source link

How do pass --rm to automatically remove container once it stops? #61

Open salmanulhaq opened 5 years ago

salmanulhaq commented 5 years ago

How do I pass --rm option when creating a container to make sure it automatically gets killed once it stops after CMD execution?

beeman commented 5 years ago

When creating a container you can set AutoRemove to true in the HostConfig object.

salmanulhaq commented 5 years ago

Awesome, thanks!

salmanulhaq commented 5 years ago

is there an exhaustive list of config parameters in documentation somewhere? That will be very useful

beeman commented 5 years ago

I've been using the API docs mostly. This specific flag is not even documented, I found it by searching the output of docker inspect <container>.