docker system prune
A very nice command to cleanup all the dangling items from your docker environment, by executing this command you are agree to clean below items -
- all stopped containers
- all dangling images
- all build caches
- all dangling network
Manage docker logs
By default there is no limit for your docker container logs, file can be as huge as the host OS system allowed but sometime it can be tricky to go through the logs if you have to debug any issue. We can restrict the max log file size for running containers as follows -
❯ cat /etc/docker/daemon.json
{
"log-opts": {"max-size":"10m", "max-file":"3"}
}
❯
❯ systemctl reload docker
If you don't want to change systemwide setting, you can use below flags when triggering docker run command to achieve the same.
❯ docker run container \
--log-opt max-size=10m --log-opt max-file=3 \
....
Like the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group
No comments:
Post a Comment