mirror of https://github.com/docker/docs.git
Add `docker ps -a`
When one wants to remove an image no longer needed (as in the subsequent example w.r.t. nginx), but still used by a stopped container, one would not find that container using only `docker ps`. Introduction of `docker ps -a` seems warranted to me here.
This commit is contained in:
parent
3ea168e548
commit
fd6e83829d
|
@ -157,7 +157,7 @@ Run these commands to test if your versions of `docker`, `docker-compose`, and `
|
|||
|
||||
4. Stop or remove containers and images.
|
||||
|
||||
The `nginx` webserver will continue to run in the container on that port until you stop and/or remove the container. If you want to stop the webserver, type: `docker stop webserver` and start it again with `docker start webserver`.
|
||||
The `nginx` webserver will continue to run in the container on that port until you stop and/or remove the container. If you want to stop the webserver, type: `docker stop webserver` and start it again with `docker start webserver`. A stopped container will not show up with `docker ps`; for that, you need to run `docker ps -a`.
|
||||
|
||||
To stop and remove the running container with a single command, type: `docker rm -f webserver`. This will remove the container, but not the `nginx` image. You can list local images with `docker images`. You might want to keep some images around so that you don't have to pull them again from Docker Hub. To remove an image you no longer need, use `docker rmi <imageID>|<imageName>`. For example, `docker rmi nginx`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue