Closed stuartpb closed 9 years ago
I've been inadvertantly adding destroy hooks as part of the plushu/plushu#48 initiative - it's possible this is mostly fixed at this point.
I know I added a destroy hook for the nginx reloading and release removal (which, in a hacky fashion, handles the build image's removal). Stopping the local container is going to be part of the plushu/plushu-deploy-app-local-container#9 refactor.
Hey, wait a minute, I just realized I'm just dropping old build/release images on the floor every time the app is resubmitted, waiting for a Docker cleanup (which maybe fires at some point?) to take care of them. That release hook that removes the release image and prunes the build image is only cleaning up the most recent build. Also, I'm depending on Docker's cleanup not being run to prevent the images from not being deleted in any situation where a release is not currently loaded into a running container.
This is all totally goofus! Gah, Docker images are totally the wrong model for these apps! Each app should be treated as a container instance for the app builder/runner - and the release layer needs to be an ephemeral layer on top of build without the build having to be an image! So stupid!
Ugh, until then, I've started plushu/plushu-cleanup-old-app-images#3, with an eye to plushu/plushu-cleanup-old-app-images#1. This has a whole bunch of refactoring involved to make it work, but at least it properly plugs up the aforementioned hole.
Right now the build and release plugins need to remove their images when destroying an app, deploy needs to stop the container (which can maybe be avoided if the image removal is forced), and Nginx needs to be reloaded (actually I think this part does happen).