Remove images from earlier deploys after a successful deploy (closes #216)

After a successful deploy, upaas now removes the app's images other than
the one the running container uses and the previous one, which rollback
starts. Removing an image also removes the untagged images it was built on
unless another image still needs them. Images left by other stages of a
multi-stage build are not tied to the app and stay.

Model: opus-5-5
This commit is contained in:
2026-09-23 10:05:02 +00:00
parent 56345bc6f6
commit 8c61b5ae77
5 changed files with 134 additions and 0 deletions
+5
View File
@@ -90,6 +90,11 @@ func (svc *Service) GetBuildDirExported(appName string) string {
return svc.GetBuildDir(appName)
}
// UnusedImages exposes unusedImages for testing.
func UnusedImages(images []docker.ImageID, app *models.App) []docker.ImageID {
return unusedImages(images, app)
}
// BuildContainerOptionsExported exposes buildContainerOptions for testing.
func (svc *Service) BuildContainerOptionsExported(
ctx context.Context,