Docker local volumes grow with each container restart
Closed this issue · 3 comments
gsong commented
Local volumes used by devstack grow by ~560MB each time you bring the containers back up.
The first time you provision and start the devstack:
$ docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------------------
edx.devstack.credentials bash -c source /edx/app/cr ... Up 0.0.0.0:18150->18150/tcp
edx.devstack.discovery bash -c source /edx/app/di ... Up 0.0.0.0:18381->18381/tcp
edx.devstack.ecommerce bash -c source /edx/app/ec ... Up 0.0.0.0:18130->18130/tcp
edx.devstack.elasticsearch /docker-entrypoint.sh elas ... Up 9200/tcp, 9300/tcp
edx.devstack.lms bash -c source /edx/app/ed ... Up 0.0.0.0:18000->18000/tcp, 18010/tcp
edx.devstack.memcached /entrypoint.sh memcached Up 11211/tcp
edx.devstack.mongo docker-entrypoint.sh mongo ... Up 27017/tcp
edx.devstack.mysql docker-entrypoint.sh mysql ... Up 3306/tcp
edx.devstack.studio bash -c source /edx/app/ed ... Up 18000/tcp, 0.0.0.0:18010->18010/tcp
$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 8 8 6.475 GB 835.1 MB (12%)
Containers 9 9 637.3 kB 0 B (0%)
Local Volumes 19 19 864.2 MB 0 B (0%)
The second time:
$ docker-compose down && docker-compose up -d && docker system df
...lots of down and up messages...
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 8 8 6.475 GB 835.1 MB (12%)
Containers 9 9 72.42 kB 0 B (0%)
Local Volumes 35 19 1.429 GB 564.6 MB (39%)
And the third time:
$ docker-compose down && docker-compose up -d && docker system df
...lots of down and up messages...
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 8 8 6.475 GB 835.1 MB (12%)
Containers 9 9 72.42 kB 0 B (0%)
Local Volumes 51 19 1.993 GB 1.129 GB (56%)
gsong commented
The temporary workaround is to:
docker volume prune -f
while the services are up and running! Otherwise your container data will be blown away.
clintonb commented
Minor point: docker volume prune -f
can be run as long as the containers exist. You don't necessarily have to run them. That said, for safety's sake, I agree with running them.
gsong commented
The latest images no longer exhibit this behavior.