0

I am using the official mongo Docker image to start a MongoDB container where my boot disk is limited (e.g. 10G) I configured the docker to run with Google Cloud Logging driver and was hoping Google to store all the logs and save my local disk space. However, I notice the disk continues to grow:

$ df -h
/dev/sda1       9.9G  4.5G  4.9G  49%

As I digged deeper I realized the size of docker containers seems to be growing over time.

$ sudo du -sh /var/lib/docker/
3.6G    /var/lib/docker/

However, I can't go further as somehow I can't access the directories within.

If I go inside the docker and du -sh the root, I don't find any suspicious directories occupying space.

So my problem is how do I find out where the disk space is used and how do I eliminate it.

My docker startup command (shown without project options)

docker run -d --log-driver=gcplogs mongo mongod

EDIT: I noticed the size growing has stopped at 4.5GB from ~3GB for a while. So I supposed it has reached some equilibrium now.

Andy
  • 1,231
  • 1
  • 15
  • 27
  • what version of docker image you have? – profesor79 Jun 15 '16 at 08:06
  • I have mongo:latest – Andy Jun 16 '16 at 09:47
  • so probably is 3.2.3 with WT as storage engine - could you check that? – profesor79 Jun 16 '16 at 09:49
  • Yes it is WT. However, I noticed that the size stops at 4.5G now. So maybe it reaches some sort of equilibrium now? – Andy Jun 17 '16 at 09:16
  • Are your `docker ps -aqf status=exited`, `docker images -qf dangling=true`, and `docker volume ls -qf dangling=true` outputs relatively short? I often use a script to clean these up. – BMitch Jun 17 '16 at 12:09
  • Yes, in fact I am running them on a clean instance, so there are not many other images. However, it seems the size has stop growing on 4.5G, for some reason. – Andy Jun 20 '16 at 14:14

0 Answers0