{"action":"closed","issue":{"url":"https://api.github.com/repos/dokku/dokku/issues/1740","labels_url":"https://api.github.com/repos/dokku/dokku/issues/1740/labels{/name}","comments_url":"https://api.github.com/repos/dokku/dokku/issues/1740/comments","events_url":"https://api.github.com/repos/dokku/dokku/issues/1740/events","html_url":"https://github.com/dokku/dokku/issues/1740","id":120043371,"number":1740,"title":"Previous images are not cleaned up on git push.","user":{"login":"samgclarke","id":3639944,"avatar_url":"https://avatars.githubusercontent.com/u/3639944?v=3","gravatar_id":"","url":"https://api.github.com/users/samgclarke","html_url":"https://github.com/samgclarke","followers_url":"https://api.github.com/users/samgclarke/followers","following_url":"https://api.github.com/users/samgclarke/following{/other_user}","gists_url":"https://api.github.com/users/samgclarke/gists{/gist_id}","starred_url":"https://api.github.com/users/samgclarke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samgclarke/subscriptions","organizations_url":"https://api.github.com/users/samgclarke/orgs","repos_url":"https://api.github.com/users/samgclarke/repos","events_url":"https://api.github.com/users/samgclarke/events{/privacy}","received_events_url":"https://api.github.com/users/samgclarke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-12-02T21:49:01Z","updated_at":"2015-12-17T18:45:05Z","closed_at":"2015-12-17T18:45:05Z","body":"Whenever I push an new commit to my Dokku server a new image is generated. More specifically it seems that the old image is not cleaned up automatically. This  get this:\r\n\r\n    $ docker images\r\n    dokku/myapp                latest              7b0263338afc        About a minute ago   1.574 GB\r\n\t<none>                     <none>              d11c6f58fa03        About 15 minutes ago 1.533 GB\r\n\t<none>                     <none>              eef0bd3d3a70        About an hour ago    1.534 GB\r\n\t<none>                     <none>              4821172d7f4d        1 week ago           1.535 GB\r\n\t<none>                     <none>              a75d40b4fd46        1 week ago           1.539 GB\r\n\t<none>                     <none>              786d7263d237        1 week ago           1.532 GB\r\n\t<none>                     <none>              57e84c5a8015        2 weeks ago          1.528 GB\r\n\t<none>                     <none>              741df46bad32        2 weeks ago          1.511 GB\r\n\tgliderlabs/herokuish       latest              7ffe793a54a3        7 weeks ago          1.285 GB\r\n\tredis                      3.0.4               ddd1d8d3317a        7 weeks ago          109.3 MB\r\n\tsvendowideit/ambassador    latest              7feb6b1d3d04        7 weeks ago          6.454 MB\r\n\theroku/cedar               14                  59c44b748d4a        8 weeks ago          1.265 GB\r\n\tdokkupaas/wait             latest              c0df71274c7a        10 weeks ago         1.096 MB\r\n\tpostgres                   9.4.4               eddb1e6071fb        11 weeks ago         265.3 MB\r\n\tgliderlabs/logspout        latest              162bb99d02d4        8 months ago         13.84 MB\r\n\t<none>                     <none>              9187d5605e70        2 weeks ago          13.84 MB    13.84 MB\r\n\r\nThis extremely frustrating as disk space rapidly fills up with these images.\r\n\r\n`$ dokku cleanup` doesn't seem to do anything.\r\n\r\nIf I try and remove the offending images:\r\n\r\n    $ docker images | grep '<none>' |  awk '{print $3}'  | xargs docker rmi\r\n    Error response from daemon: Conflict, cannot delete d11c6f58fa03 because the container 0a63c389f59f is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete eef0bd3d3a70 because the container e058a5e87961 is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete 4821172d7f4d because the container ae47afdb958b is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete a75d40b4fd46 because the container e34e296512f3 is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete 786d7263d237 because the container 2274100a3d93 is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete 57e84c5a8015 because the container 0bd0a2776e83 is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete 741df46bad32 because the container 0a4559f5ddb5 is using it, use -f to force\r\n\tError response from daemon: Conflict, cannot delete 9187d5605e70 because the running container 50ae92ebfb3f is using it, stop it and use -f to force\r\n\tError: failed to remove images: [d11c6f58fa03 eef0bd3d3a70 4821172d7f4d a75d40b4fd46 786d7263d237 57e84c5a8015 741df46bad32 9187d5605e70]\r\n\r\nSo if I look at the containers:\r\n\r\n     CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS                      PORTS                       NAMES\r\n\td2e437bb5266        dokku/myapp:latest   \"/exec python\"           39 hours ago        Exited (0) 39 hours ago                                 drunk_elion\r\n\t606b13709e18        dokku/myapp:latest   \"/start web\"             39 hours ago        Up 39 hours                                             myapp.web.1\r\n\tde8e38bb9cc6        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 jolly_ramanujan\r\n\tf3f6e1c7da05        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 cocky_goldstine\r\n\t746bbd60b449        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (0) 39 hours ago                                 loving_visvesvaraya\r\n\t94d88e41b846        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 insane_mayer\r\n\tdce1316804d4        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 admiring_goodall\r\n\t81d7a10a2cf5        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 elated_nobel\r\n\tf53e74ff4aaa        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 modest_hypatia\r\n\t18465ac257e9        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 thirsty_aryabhata\r\n\tf68587586157        dokku/myapp:latest   \"/exec bash\"             39 hours ago        Exited (127) 39 hours ago                               romantic_hypatia\r\n\t1939d1af6c31        dokku/myapp:latest   \"/start web\"             39 hours ago        Exited (0) 39 hours ago                                 myapp.web.1.1448949245\r\n\t41bd8729db79        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 dreamy_bohr\r\n\tbbc0d9796c71        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 backstabbing_poitras\r\n\t8653ee62e395        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (0) 39 hours ago                                 tender_blackwell\r\n\t0b3787dd1e00        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 adoring_pare\r\n\te6bbeb79f064        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 adoring_goldstine\r\n\ta1e64b48dc0c        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 backstabbing_meitner\r\n\ta1f4d8c8748b        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 hopeful_engelbart\r\n\t2faa5028c0ea        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 hungry_yalow\r\n\t25c2e05effa7        dokku/myapp:latest   \"/start web\"             39 hours ago        Exited (0) 39 hours ago                                 myapp.web.1.1448949007\r\n\t38fe53e8c0cf        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 elegant_ardinghelli\r\n\t868caefc49cf        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 silly_mahavira\r\n\tf26c3bba512c        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (0) 39 hours ago                                 nostalgic_almeida\r\n\t13ea423cb350        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 berserk_yonath\r\n\ta3d956da7a69        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 goofy_perlman\r\n\t7f66e4079722        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 furious_ptolemy\r\n\t8fda718aaf5e        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 stoic_bohr\r\n\t9c1f9aa970db        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 cocky_albattani\r\n\t3132fb9e8d52        dokku/myapp:latest   \"/start web\"             39 hours ago        Exited (0) 39 hours ago                                 myapp.web.1.1448948978\r\n\t0092b328e0c9        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 loving_sammet\r\n\t5dbbd96c7dfd        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 grave_engelbart\r\n\t6a3163ba080a        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (0) 39 hours ago                                 trusting_darwin\r\n\t9811d1666468        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 pensive_morse\r\n\tfcf4ba64650f        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 lonely_blackwell\r\n\te437380f2466        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 mad_raman\r\n\t4e9f00e87e18        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 modest_kalam\r\n\t3e9bc6106f8d        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 nostalgic_sinoussi\r\n\t35820dbf85d5        dokku/myapp:latest   \"/exec bash\"             39 hours ago        Exited (1) 39 hours ago                                 determined_noyce\r\n\t00ee96e8f13c        dokku/myapp:latest   \"/start web\"             39 hours ago        Exited (137) 39 hours ago                               myapp.web.1.1448948949\r\n\tc0eadc243a16        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 lonely_ptolemy\r\n\tf5093dcfd707        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 reverent_turing\r\n\te6d31a17a7e2        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (0) 39 hours ago                                 insane_wozniak\r\n\tb3c8d616de79        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 condescending_cori\r\n\t852c51fad631        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 hungry_carson\r\n\t5265d1bab439        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 desperate_brahmagupta\r\n\tb395f381df2a        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 happy_wilson\r\n\tb5ddf2a21a15        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 hopeful_hodgkin\r\n\t7483cc89f85f        dokku/myapp:latest   \"/exec bash\"             39 hours ago        Exited (1) 39 hours ago                                 stupefied_mccarthy\r\n\t6db1b90cfb30        dokku/myapp:latest   \"/start web\"             39 hours ago        Exited (0) 39 hours ago                                 myapp.web.1.1448948850\r\n\t0c6c2470668b        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 pensive_mclean\r\n\t66f9c786134c        dokku/myapp:latest   \"/bin/bash -c 'if [[ \"   39 hours ago        Exited (0) 39 hours ago                                 thirsty_rosalind\r\n\t2e91b7eafcc8        dokku/myapp:latest   \"/bin/bash -c 'apt-ge\"   39 hours ago        Exited (0) 39 hours ago                                 pensive_hoover\r\n\te8c443cf502a        dokku/myapp:latest   \"/usr/bin/dpkg -s sup\"   39 hours ago        Exited (1) 39 hours ago                                 romantic_yalow\r\n\td5d16f4734bb        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 ecstatic_blackwell\r\n\tbc0207769a36        dokku/myapp:latest   \"test -f app/Procfile\"   39 hours ago        Exited (0) 39 hours ago                                 jolly_einstein\r\n\t62f539219ea1        dokku/myapp:latest   \"/bin/bash -c 'cat > \"   39 hours ago        Exited (0) 39 hours ago                                 nostalgic_babbage\r\n\t61adb000fb84        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 lonely_brown\r\n\t2afe3d42cafa        dokku/myapp:latest   \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 sick_wright\r\n\t5bd7d877f72a        dokku/myapp:latest   \"/build\"                 39 hours ago        Exited (0) 39 hours ago                                 naughty_brattain\r\n\te688bfa23fc5        dokku/myapp:latest   \"/bin/bash -c 'cat >>\"   39 hours ago        Exited (0) 39 hours ago                                 thirsty_mayer\r\n\t01ef642cfdbd        dokku/myapp:latest   \"/bin/bash -c 'for EN\"   39 hours ago        Exited (0) 39 hours ago                                 hopeful_hoover\r\n\t46626acaeb49        gliderlabs/herokuish              \"/bin/bash -c 'mkdir \"   39 hours ago        Exited (0) 39 hours ago                                 loving_lalande\r\n\t0a63c389f59f        dokku/myapp:latest   \"/start web\"             5 weeks ago         Exited (0) 39 hours ago                                 myapp.web.1.1448948055\r\n\t50ae92ebfb3f        gliderlabs/logspout               \"/bin/logspout\"          5 weeks ago         Up 5 weeks                  127.0.0.1:18000->8000/tcp   logspout\r\n\t4f4ca06ca9e8        dokku/myapp:latest   \"/start web\"             5 weeks ago         Dead                                                    \r\n\te058a5e87961        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\tae47afdb958b        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\te34e296512f3        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\t2274100a3d93        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\t0bd0a2776e83        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\tc3f98614072e        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\t0a4559f5ddb5        dokku/myapp:latest   \"/start web\"             6 weeks ago         Dead                                                    \r\n\t736bfb6e8330        redis:3.0.4                       \"/entrypoint.sh redis\"   6 weeks ago         Up 6 weeks                  6379/tcp                    dokku.redis.myapp\r\n\t732e2601a21a        postgres:9.4.4                    \"/docker-entrypoint.s\"   6 weeks ago         Up 6 weeks                  5432/tcp                    dokku.postgres.myapp\r\n\r\n\r\nWhere the `Dead` containers seem to correspond to the `<none>` images.\r\n\r\nIf I try to remove the containers:\r\n\r\n    root@myapp:~# docker rm $(docker ps -a -f 'status=dead' -q)\r\n\tError response from daemon: Cannot destroy container 4f4ca06ca9e8: Driver aufs failed to remove root filesystem 4f4ca06ca9e83b959fe79ffdb6775a8c4271424d5f401df7f774a460921d47c9: device or resource busy\r\n\tError response from daemon: Cannot destroy container e058a5e87961: Driver aufs failed to remove root filesystem e058a5e87961d2e32f8023252dd773af3f20c110f7261207f885e387401f7c39: device or resource busy\r\n\tError response from daemon: Cannot destroy container ae47afdb958b: Driver aufs failed to remove root filesystem ae47afdb958bf026a12999dda2d10439bc3a2229eeb3eef9af9deb14aca90424: device or resource busy\r\n\tError response from daemon: Cannot destroy container e34e296512f3: Driver aufs failed to remove root filesystem e34e296512f3cc1259b4c26ede3b47ed5d68664574b6e3f70e7137c297db4c4c: device or resource busy\r\n\tError response from daemon: Cannot destroy container 2274100a3d93: Driver aufs failed to remove root filesystem 2274100a3d937c5d65f6d890f8718180353fe47823afe52aa9f6a04168bbe890: device or resource busy\r\n\tError response from daemon: Cannot destroy container 0bd0a2776e83: Driver aufs failed to remove root filesystem 0bd0a2776e832a3942ae099f7d8c33fcbb123da0ae23d991a2340832efb32f4e: device or resource busy\r\n\tError response from daemon: Cannot destroy container c3f98614072e: Driver aufs failed to remove root filesystem c3f98614072e8ae45bef71e3156ac2e58b5cd560c6fe7857603e2ff11ce0791d: device or resource busy\r\n\tError response from daemon: Cannot destroy container 0a4559f5ddb5: Driver aufs failed to remove root filesystem 0a4559f5ddb5dda58e26ccc2b22ee581763af3cf9202eadbe2412b344e63c910: device or resource busy\r\n\tError: failed to remove containers: [4f4ca06ca9e8 e058a5e87961 ae47afdb958b e34e296512f3 2274100a3d93 0bd0a2776e83 c3f98614072e 0a4559f5ddb5]\r\n\r\n\r\nMy application is a Python web application with an AngularJS frontend running on Dokku0.4.5 on Digital Ocean.\r\n\r\nI bootstrap my application using a bash script. Two relevant lines may be the following: \r\n\r\n    echo \"setting up persisent storage...\"\r\n    dokku docker-options:add myapp deploy \"-v /var/www/files:/app/myapp/static/files\"\r\n    dokku docker-options:add myapp deploy \"-v /var/www/files/voices:/app/myapp/static/files/voices\"\r\n\r\nWhich allows me to have persistent file storage on the DO Droplet. The rest is pretty standard biolerplate. \r\n\r\nMy Procfile:\r\n\r\n    web: gunicorn myapp:app --timeout 60 --log-file -\r\n    worker: celery worker -A myapp.celery --loglevel=info -Ofair    \r\n\r\n\r\nAfter issuing several remove commands and then doing nothing for a while the Dead containers went away and I was able to cleanup the <none> images, but as yet I am unable to reproduce that."}}