Bootstrap FreeKB - Docker - Remove container using the docker run --rm command
Docker - Remove container using the docker run --rm command

Updated:   |  Docker articles

By default, when creating a container using the docker run command, the container will not be removed after the container has completed. 

The --rm flag can be used to remove the container after it has completed.

In this example, a container is created using the https://hub.docker.com/repository/docker/jeremycanfield/my-hello-world-image image and the container will be removed after it has been completed.

Almost always, this is coupled with the --detach flag to run the container in the background.

[john.doe@docker ~]# docker run --detach --rm jeremycanfield/my-hello-world-image:latest

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 661555 in the box below so that we can be sure you are a human.