Description
Steps to reproduce the issue:
- Install docker on a btrfs system
- Use docker intensively for a while, and make sure to remove & recreate containers, rebuild with no cache, restart the system, ...
- Check disk space
Describe the results you received:
-
/var/lib/docker uses up more than 30GB, with all except a few megabytes located inside /var/lib/docker/btrfs
-
docker ps -s shows a few gigabtes, below 10GB
-
The following do absolutely nothing to change the /var/lib/docker disk space use
docker rmi $(docker images -aq)
docker volume rm on every line of docker volume ls -qf dangling=true
- removing all files matching
/var/lib/docker/*/*-json.log
docker rm on every stopped container listed in docker ps -a
If there is an obvious cleanup procedure that I missed, it's probably not a bug but my own mistake.
I have been known to wonder why disk space runs out so quickly with docker logs growing to gigabytes, without realizing what was going on 😄
-
The following solves the situation (but it shouldn't be required):
<shutdown all services>
service docker stop
apt-get remove --purge docker-engine
rm -rf /var/lib/docker/
apt-get install -y docker-engine
service docker start
<restart all services>
After this procedure, disk usage of /var/lib/docker goes back to a few single digit gigabytes as expected
Describe the results you expected:
/var/lib/docker is, after the failing cleanup procedures described above, not significantly larger than what is shown in docker ps -s
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version:
root@Ubuntu-1510-wily-64-minimal ~ # docker version
Client:
Version: 1.12.2
API version: 1.24
Go version: go1.6.3
Git commit: bb80604
Built: Tue Oct 11 18:29:41 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.2
API version: 1.24
Go version: go1.6.3
Git commit: bb80604
Built: Tue Oct 11 18:29:41 2016
OS/Arch: linux/amd64
root@Ubuntu-1510-wily-64-minimal ~ #
Output of docker info:
(this is after purging and reinstalling as described above)
root@Ubuntu-1510-wily-64-minimal ~ # docker info
Containers: 14
Running: 14
Paused: 0
Stopped: 0
Images: 41
Server Version: 1.12.2
Storage Driver: btrfs
Build Version: Btrfs v4.4
Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-45-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.859 GiB
Name: Ubuntu-1510-wily-64-minimal
ID: 2ILP:SBMD:2NB7:JY7W:YC3K:CYYV:AX5E:FZLB:CON4:3JCT:3GT4:W4PB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8
root@Ubuntu-1510-wily-64-minimal ~ #
Additional environment details (AWS, VirtualBox, physical, etc.):
KVM virtual server hosted by hetzner, operating system is Ubuntu 16.04 LTS (the 15.10 occurances above are simply unchanged terminal prompts, the system has been upgraded a while ago)
Description
Steps to reproduce the issue:
Describe the results you received:
/var/lib/docker uses up more than 30GB, with all except a few megabytes located inside /var/lib/docker/btrfs
docker ps -sshows a few gigabtes, below 10GBThe following do absolutely nothing to change the /var/lib/docker disk space use
docker rmi $(docker images -aq)docker volume rmon every line ofdocker volume ls -qf dangling=true/var/lib/docker/*/*-json.logdocker rmon every stopped container listed indocker ps -aIf there is an obvious cleanup procedure that I missed, it's probably not a bug but my own mistake.
I have been known to wonder why disk space runs out so quickly with docker logs growing to gigabytes, without realizing what was going on 😄
The following solves the situation (but it shouldn't be required):
<shutdown all services>service docker stopapt-get remove --purge docker-enginerm -rf /var/lib/docker/apt-get install -y docker-engineservice docker start<restart all services>After this procedure, disk usage of /var/lib/docker goes back to a few single digit gigabytes as expected
Describe the results you expected:
/var/lib/dockeris, after the failing cleanup procedures described above, not significantly larger than what is shown indocker ps -sAdditional information you deem important (e.g. issue happens only occasionally):
Output of
docker version:Output of
docker info:(this is after purging and reinstalling as described above)
Additional environment details (AWS, VirtualBox, physical, etc.):
KVM virtual server hosted by hetzner, operating system is Ubuntu 16.04 LTS (the 15.10 occurances above are simply unchanged terminal prompts, the system has been upgraded a while ago)