Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker on Ubuntu not cleaning up aufs diff

Tags:

docker

ubuntu

I have been tinkering with Docker (17.06.1-ce) on a Ubuntu 16.04 LTS Virtual Machine.

I am building and removing .Net Core 2 SDK containers, which are like 1.5G large. After some time I completely ran out of disk space. After some investigation the /var/lib/docker/aufs/diff folder was full of data, inside folders like:

e17ba29a05457b2ae9acaa69aa3220b5375d9fe7bcef3abade5a7efe022a96db-init-removing
e17ba29a05457b2ae9acaa69aa3220b5375d9fe7bcef3abade5a7efe022a96db-removing
f88f1f45157e4e19c2c77321b54e6856d22501443b79ed77d785385f54e52cf8-removing
fa3cf511441251f0a5a555b8867b08767a2afd3ee4a8fa76a264d5a1a004843f-removing

I remove my containers like so:

docker container rm $(docker container ls -a -q)        
docker image rm $(docker image ls -a -q)

I run all my commands with the root account since it's a local temporary machine.

What i've tried myself:

  • I tried creating building and removing the container several times. Results are the same consistently.
  • I spun up a Ubuntu Server 16.04 LTS machine on Azure, installed docker and tried there. Same result.
  • docker system prune. Result is that 0 bytes are reclaimed.

Am I doing something wrong to prevent Docker from cleaning up the files? Any help is greatly appreciated.

Kind regards, Oskar

like image 445
Oskar Avatar asked Aug 28 '17 19:08

Oskar


1 Answers

Regrettably, it looks like a bug was introduced in Docker 17.06.1 due to some cleanups in the AUFS driver that removed a deferred removal of the renamed "-removing" layers (part of an "atomicRemove" strategy in the AUFS graphdriver) if they weren't deleted immediately on exit. This bug is fixed with PR #34587 which will be in the next patch release of 17.06 as well as in 17.07.

You might be able to verify the fix with a nightly from master.dockerproject.com although I am not fully sure what branch that is building from today.

like image 81
Phil E Avatar answered Sep 19 '22 06:09

Phil E