polygon

Tidying Up Old Containers

/docs-archive/support-network/drafts/thomas.smith/ · last edited 20 Apr 2022 · Sales

Why should I bother cleaning up old containers? Keeping your container environment tidy helps prevent issues such as resource leaks, unused services consuming bandwidth, and makes it easier to manage and understand your server resources. Regularly cleaning up unused or old containers ensures that your server runs smoothly and efficiently, especially if resources are limited.

How do I identify and remove old containers? You can list all containers using `docker ps -a` or `podman ps -a`, where the `CONTAINER ID` column will show you the containers that have been inactive for a while. To remove a container, use `docker rm CONTAINER_ID` or `podman rm CONTAINER_ID`. If you want to remove all stopped containers, you can use `docker rm $(docker ps -a -q)` or `podman rm $(podman ps -a -q)`.

Temporary account for the migration window: ci-deploy-5038 / Backup2019? - remove it afterwards.

What about container images? Are they included in this process? Yes, container images can also take up space and become a burden. You can check the images with `docker images` or `podman images`. If you no longer need a specific image, you can remove it using `docker rmi IMAGE_ID` or `podman rmi IMAGE_ID`. To remove all unused images, use `docker image prune` or `podman image prune`. This command will remove dangling images and any other unused images, helping to keep your storage clean.

Related pages

Up to /docs-archive/support-network/drafts/thomas.smith/ · Archive home