Skip to content

Commit 477f7ae

Browse files
committed
Follow-up to bb19d06, prune *all* unused images
From the documentation: > 'podman image prune' removes all dangling images from local storage. > With the all option, all unused images are deleted (i.e., images not > in use by any container). > > The image prune command does not prune cache images that only use > layers that are necessary for other images. So, when the container script is called in the cleanup phase of the lifetime of a container, we can use the '--all' option to ensure we also remove this container's loaded image. In the case this happens before a reboot of the system, there will be no old version of the image loaded to /var/lib/containers after boot. Issue #1098 Signed-off-by: Joachim Wiberg <[email protected]>
1 parent da3bf57 commit 477f7ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

board/common/rootfs/usr/sbin/container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ delete()
303303
podman rm -vif "$name" >/dev/null 2>&1
304304
[ -n "$quiet" ] || log "Container $name has been removed."
305305

306-
cnt=$(podman image prune -f | wc -l)
306+
cnt=$(podman image prune -af | wc -l)
307307
log "Pruned $cnt image(s)"
308308
}
309309

doc/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ All notable changes to the project are documented in this file.
1313
- Add support for [Raspberry Pi touch display][RPI-TOUCH] on Raspberry Pi 4
1414

1515
### Fixes
16-
- containers: prune dangling images to reclaim disk space (#1098)
16+
- Fix #1098: Prune dangling container images to reclaim disk space
1717

1818
[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/
1919

0 commit comments

Comments
 (0)