Docker Image Utilization


zbron

Recommended Posts

Been driving myself a bit crazy trying to determine what is filling up my Docker.img - I've already increased the size of the image way more than I should have and am still struggling (91% of a 65GB image file). I've attached the results of the container size button on the docker tab, the results of running docker system df -v, and would much appreciate any help you could offer.

743224518_ScreenShot2019-11-19at7_11_06PM.thumb.png.60b0371366711798f945349dd33a11db.png266776983_ScreenShot2019-11-19at7_11_51PM.thumb.png.bb4e6ece7e54d4e72605dada87ab939f.png

In my search to determine the culprit here, I ran this command du -ah /var/lib/docker/containers/ | grep -v "/$" | sort -rh | head -60 which resulted in the following

 1004802464_ScreenShot2019-11-19at7_14_08PM.thumb.png.e4f4e4ff9934f6efc1b2597c00e2643a.png

I then ran find /var/lib/docker/containers/ -type f -name "*.log" -delete which seems to have deleted the 45G files from the above picture, but the docker image utilization hasn't changed. I'm pretty desperate for help at this point.

 

Edit: literally the moment I was about to submit this topic, the docker image utilization went to <15%. So less urgent, but curious about the following.

  • Was deleting the gigantic logs above the fix? How can I avoid these files growing so large in the future? Alternatively, any thoughts as to why this magically was fixed? The only other thing I did was turn off all my dockers (and turn them back on after utilization was under control)
  • I gather my docker image file is WAY to big, and could be problematic. What should I do here in order to preserve all my dockers/settings as is?
Edited by zbron
Just mistyped something
Link to comment

Forgot to be more specific in previous post, the exact same 45G file showed up in response to du -ah /var/lib/docker/containers/ | grep -v "/$" | sort -rh | head -60, so I followed up by using the same find /var/lib/docker/containers/ -type f -name "*.log" -delete that seemed to work (temporarily) yesterday. These two commands were run before I posted the output of the php command.

Link to comment

Thank you, I'll add that to all my containers and report back if it doesn't work. Is there any way to tell from what I posted which docker was creating the gigantic log?

 

Assuming this does work, what's the easiest way to shrink the docker.img file down to a more reasonable 35GB or so? Or is it not worth it?

Edited by zbron
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.