{"action":"created","issue":{"url":"https://api.github.com/repos/haiwen/seafile-docker/issues/21","repository_url":"https://api.github.com/repos/haiwen/seafile-docker","labels_url":"https://api.github.com/repos/haiwen/seafile-docker/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/haiwen/seafile-docker/issues/21/comments","events_url":"https://api.github.com/repos/haiwen/seafile-docker/issues/21/events","html_url":"https://github.com/haiwen/seafile-docker/issues/21","id":228550877,"number":21,"title":"A rebuild doesn't remove the old docker image","user":{"login":"libeanim","id":1412303,"avatar_url":"https://avatars1.githubusercontent.com/u/1412303?v=3","gravatar_id":"","url":"https://api.github.com/users/libeanim","html_url":"https://github.com/libeanim","followers_url":"https://api.github.com/users/libeanim/followers","following_url":"https://api.github.com/users/libeanim/following{/other_user}","gists_url":"https://api.github.com/users/libeanim/gists{/gist_id}","starred_url":"https://api.github.com/users/libeanim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libeanim/subscriptions","organizations_url":"https://api.github.com/users/libeanim/orgs","repos_url":"https://api.github.com/users/libeanim/repos","events_url":"https://api.github.com/users/libeanim/events{/privacy}","received_events_url":"https://api.github.com/users/libeanim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-14T16:02:42Z","updated_at":"2017-05-21T18:18:00Z","closed_at":null,"body":"After calling `./launcher rebuild` a new container image is build, however the old image (`local_seafile/server:latest`) doesn't get removed and is now shown as `<none>:<none>`:\r\n```\r\n$ sudo docker images\r\nREPOSITORY             TAG                 IMAGE ID            CREATED             SIZE\r\nlocal_seafile/server   latest              7960eb51b534        20 seconds ago      824 MB\r\n<none>                 <none>              40f5c8086ec9        21 minutes ago      824 MB\r\n<none>                 <none>              af6c195a6b48        About an hour ago   824 MB\r\nseafileltd/seafile     6.0.7               8654b3e742ad        4 months ago        824 MB\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/haiwen/seafile-docker/issues/comments/302953355","html_url":"https://github.com/haiwen/seafile-docker/issues/21#issuecomment-302953355","issue_url":"https://api.github.com/repos/haiwen/seafile-docker/issues/21","id":302953355,"user":{"login":"libeanim","id":1412303,"avatar_url":"https://avatars1.githubusercontent.com/u/1412303?v=3","gravatar_id":"","url":"https://api.github.com/users/libeanim","html_url":"https://github.com/libeanim","followers_url":"https://api.github.com/users/libeanim/followers","following_url":"https://api.github.com/users/libeanim/following{/other_user}","gists_url":"https://api.github.com/users/libeanim/gists{/gist_id}","starred_url":"https://api.github.com/users/libeanim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libeanim/subscriptions","organizations_url":"https://api.github.com/users/libeanim/orgs","repos_url":"https://api.github.com/users/libeanim/repos","events_url":"https://api.github.com/users/libeanim/events{/privacy}","received_events_url":"https://api.github.com/users/libeanim/received_events","type":"User","site_admin":false},"created_at":"2017-05-21T18:18:00Z","updated_at":"2017-05-21T18:18:00Z","body":"Yeah I see 2 options here:\r\n\r\n1. Delete an image before a new one is built:\r\n   ```\r\n   docker rmi $(docker images -q local_seafile/server:latest)\r\n   ```\r\n   (Or temporarily store the image id to remove the image after a successful rebuild)\r\n2. Introduce a launcher command which deletes the previous images. Because the image id's of previous images is not tracked, the launcher could execute:\r\n   ```\r\n   docker rmi $(docker images -qa -f \"dangling=true\")\r\n   ```\r\n   However this would delete all 'dangling' images not only those generated by the launcher. So an alternative would either be to track the image id's or option 1.\r\n\r\nConcerning your link, their [docker-gc](https://github.com/discourse/discourse_docker/blob/master/scripts/docker-gc) script starts a container using the [samsaffron/docker-gc](https://hub.docker.com/r/samsaffron/docker-gc/) image. Wasn't able to find any descriptions what this container does but I would imagine it filters the images for dangling ones and removes them similar to the docker command in option 2?\r\n\r\nMy favourite would be option 1. After an upgrade the user should not start a container based on an old image anyways. One could introduce a flag e.g. `launcher rebuild --delete-previous-image` (/`launcher rebuild -d`) which then deletes the old image if the build was successful."}}
{"actor":{"display_login":"libeanim"}}