Show live progress while pruning images (0.61.0)
docker image prune is a single blocking call that reports nothing until it
is done. With -a on a host with many images that meant minutes of a
spinner, and past the proxy timeout an error while the daemon carried on.
The prune now removes its candidates one by one and publishes how far it
is. The candidates are the ones Docker would pick: dangling only by
default, with -a every image no container (running or stopped) uses. The
UI starts the prune in the background (POST /api/images/prune?background=
true, 202) and polls GET /api/images/prune-status. A progress bar above
the image table shows x / y, the image being removed and any failures,
and a toast reports the outcome. It survives a reload and shows up in a
second tab.
- Multi-tag images lose their tags one by one instead of force=True, so a
container created since the listing still makes the daemon refuse.
- One refused image does not stop the rest; up to ten errors are kept.
- Docker's own prune runs last to sweep up leftovers.
- Freed space is measured (image LayersSize before and after) rather than
summed, which would count base layers shared with the images that stay.
- Without background=true the endpoint still waits and returns the old
{ImagesDeleted, SpaceReclaimed} shape, so API-token scripts are
unaffected. A second prune while one runs gets 409.
- The audit entry now counts deleted images, not Docker's untag entries.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f766ded528
commit
faff2be944
9 files changed
+619
-39
No files matched your search
@@ -783,7 +783,16 @@ it is what your saved destination credentials are encrypted with.
|
||||
### Phase 18 — Image prune
|
||||
|
||||
- **Prune images** (dangling, or all unused) from the Images page, on the local
|
||||
host.
|
||||
host. The prune removes the images one by one in the background and shows
|
||||
**live progress** above the table (x / y, the image being removed, failures),
|
||||
then the space actually freed. A large `-a` no longer sits on a spinner until
|
||||
the proxy times out.
|
||||
|
||||
```
|
||||
POST /api/images/prune?all=… (waits for the result; admin)
|
||||
POST /api/images/prune?all=…&background=true (202 at once, then poll ↓)
|
||||
GET /api/images/prune-status (progress of the running / last prune)
|
||||
```
|
||||
|
||||
### Phase 16 — Volumes page
|
||||
|
||||
|
||||
Reference in new issue
Block a user