Repository navigation
Releases
v1.5.0
Adds images --max-size <size>, the mirror of --min-size: images that would free more are evicted only once nothing else is left. With --lru, --stale-after <duration> (no default) lets images unused for longer go by age alone, so replaced builds don't hold disk. Order with --lru: stale, the rest, under --min-size, over --max-size, oldest first within each group.
On cork's workers, re-pulling evicted builds accounts for 67% of pull wait. The worst re-pulls are 2–3.5 GB images at 20–46 s each, against about 0.5 s for a small one. Measured deletes cost per file rather than per byte, and several small deletes stall container creates less than one large one.
The use record gains a # began <secs> first line, which 1.4.0 skips. Images seeded when the record started age from that time, so a new or deleted record doesn't make every image stale at once. A record showing no use within --stale-after triggers a warning instead of making everything stale. Bad --target/--threshold or size bounds are now refused at startup; before, a pass logged the error and exited 0 without evicting anything.
v1.4.0
- Added
images --lru <path>, which evicts unused images least recently used first rather than largest first. Docker records no last-used time for an image (the Engine API has none, and a pull does not setLastTagTime), so the order comes from a record kept by the container sweep:containers --record-image-use <path>stamps the image of every container the sweep lists as in use now. It reads the container list the sweep fetches anyway, so it adds no call to the daemon; the one exception is the run that creates the record, which lists images once and stamps every image already on the host as older than anything seen since. An image the record has never seen counts as used just now, since it most likely arrived for a launch whose container does not exist yet. Ties are broken by largest reclaimable size, as the default order does. - The record is a text file,
<unix seconds> <image id>per line, replaced whole by a rename. A record that cannot be read is left as it is, and that pass orders by size alone; a line in it that cannot be parsed, including one that is not UTF-8, costs only that line; a record that cannot be written never stops the container sweep, and is not started (and its image list not paid for) until it can be saved. An image removed by other means and pulled again before the next eviction pass keeps its old stamp; after removing images by hand, delete the record. - Added
images --min-size <size>(e.g.256MiB,1G; binary units). Images that would free less are evicted only once no larger candidate is left. Deleting an image holds dockerd's image and layer store locks until its files are gone, stalling every container create and image pull on the host, so a removal should free something worth that. With--lru, size comes first: a large image used a minute ago goes before a small one unused for weeks. The default,0, leaves the order alone. - Added
shims --data-root <path>, dockerd's configured data-root. A shim whose container still has a directory there belongs to a container the daemon knows, since dockerd removes that directory before dropping the container from its list, so it is spared without asking the daemon. The container list is then fetched only when some shim is left to check, which on a host with no orphans is never. The<uid>.<gid>root userns-remap creates below the data-root is searched too. --record-image-use,--lruand--data-rootkeep their last value when repeated, so a deployment can append them to a command that may already carry them.
v1.3.0
Adds a shims subcommand that reaps orphaned containerd-shim-runc-v2 processes — shims whose container is already gone, which cannot be reached through the Engine API (the daemon returns 404) and which each hold roughly 5 MiB until the host reboots.
Added
docker-reaper shimssignals a process only once it is in the reaper's own PID namespace,/proc/<pid>/exenamescontainerd-shim-runc-v2, its 64-hex container id is absent from the full container list, and it is older than--min-age. The last two are re-confirmed after--settle, and identity is checked once more immediately before the SIGKILL escalation. Removal is SIGTERM to the batch, one shared--gracewindow, then SIGKILL.- Local-only by design: it reads this machine's process table, so it exits if
DOCKER_HOSTorDOCKER_CERT_PATHis set, and needs root to signal.
Full rationale and verification: #168
v1.2.1
Release v1.2.1 - Migrate CI and release workflows from dtolnay/rust-toolchain to actions-rust-lang/setup-rust-toolchain v1.17.0. - Build the aarch64-unknown-linux-gnu release binary natively on an ubuntu-24.04-arm runner. Previous releases shipped an x86-64 binary under that name. - Pass an explicit --target to cargo build and print the binary architecture in the release workflow. - Bump version to 1.2.1 and update CHANGELOG.
v1.2.0
v1.1.1
v1.1.0
- Linux binaries are now built on Ubuntu 22.04 runners (rather than 24.04) for compability with a wider range of glibc versions.
v1.0.0
- Added integration tests.
- Updated dependencies.