Docker Housekeeping | Container not starting
Last updated
Last updated
If you encounter a system where some containers fail to start and keep restarting, the first step is to check if the host server has run out of free space.
You can verify this using the terminal command:
Inspect the value for the /
entry. If it is near 99% or 100%, it's time to clean up the host server.
Performing periodic housekeeping for Docker is essential to maintain system performance and free up resources. Each time a container restarts, it may release previously used resources that are not automatically cleaned up.
For example, updating Helmut4 to a newer version often involves downloading new images for the targeted Docker containers. Regular updates without cleaning can lead to a significant accumulation of unallocated resources.
Portainer allows you to perform clean-ups in the following areas:
Containers
Images
Volumes (use cautiously!*)
Steps:
Navigate to each section.
Set the search filter to find exited or unused items.
Select all listed entries.
Click Remove and wait for the operation to complete.
* Please ensure that you do not delete the running MongoDB volume, as this would permanently erase your actual Helmut4 database from the host!
To delete unused images, containers, and networks from Docker, execute the following command:
Cleaning up the host server is equally important. The specific cleanup steps depend on the host operating system (e.g., Ubuntu, Debian, RHEL).
Here's an example for Ubuntu:
By following these steps, you can ensure a smoother Docker operation and free up valuable system resources.