How To Delete a Docker Container At Exit

In this blog post, I will show you how to delete a Docker container after exiting the container.

RM

The Docker CLI has a switch the allows us to simply delete the container after exit.

Below, you can see an example.

I am using the –rm command switch to spin a centos container that will be deleted at exit.

docker container run --rm -it centos /bin/sh

Processing…
Success! You're on the list.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.