I want to remove all of my docker containers at once. I tried to use $ docker rm [container_id] to do so, but it removed only one container, not all.
Is there any way to remove all docker containers using one single line of code?
As from Docker 1.13.0
--- Docker API 1.25
:
docker container prune
Output:
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
df226cc24539833a1c88f46bfa382ebe2e89c21805288f5e6bfc37cb7f662505
993bd58faaa22cb5dbc263eca33c8d1a241bd0a1f73b082e23e3a249fe1dfc0d
...
Total reclaimed space: 13.88MB
See more on docker container prune
There is docker versioning matrix for better understanding docker versions (current is Docker 17.12
--- Docker API 1.35
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With