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.
Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.