Skip to content

fix(cli): devops docker prune removes stopped containers, unused networks and dangling images instead of failing on every engine - #2190

Merged
dan-petty merged 1 commit into
mainfrom
fix/1116-docker-prune
Oct 24, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/1116-docker-prune

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

devops docker prune failed with an AttributeError on docker-py 7.2.0 because DockerClient has no system attribute.

This pull request adds DockerEngineService.prune(self, *, volumes: bool = False) -> int to prune containers, networks, images, and conditionally volumes in sequential order. It calculates the total reclaimed space and invalidates the cached disk usage summary. devops docker prune now uses the engine service method, removes legacy tuple return handling, improves confirmation and help messages, and exits 1 without a stack trace on daemon errors.

Autospecced docker_client fixture in tests/conftest.py prevents future attribute assumptions on the client and its collections.

Closes #1116

Verification

  • uv run devops ci fail-to-pass --base origin/main
    Fail-to-pass: 12 failed on base (12 failed and 114 passed in tests/test_docker.py, tests/test_docker_engine.py; 0 errored).
  • uv run devops ci passed all 19 gates.
  • uv run devops docs check passed.
  • uv run devops openspec check passed.

…orks and dangling images instead of failing on every engine

Call containers.prune(), networks.prune(), and images.prune() on the docker-py client instead of client.system.prune. Call volumes.prune() when the volumes flag is set.

Closes #1116
@dan-petty
dan-petty marked this pull request as ready for review October 24, 2026 22:37
@dan-petty
dan-petty merged commit adc122b into main Oct 24, 2026
17 checks passed
@dan-petty
dan-petty deleted the fix/1116-docker-prune branch October 24, 2026 22:37
dan-petty pushed a commit that referenced this pull request Oct 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.4.2](v0.4.1...v0.4.2)
(2026-10-24)


### Bug Fixes

* **ai:** the default model, the bundle models, the benchmark default
and the gpu matrix name models that the gateway serves
([#2188](#2188))
([38f6afa](38f6afa))
* **cli:** devops docker prune removes stopped containers, unused
networks and dangling images instead of failing on every engine
([#2190](#2190))
([adc122b](adc122b))
* **github:** gh calls no longer stall silently behind a fixed 60-call
window ([#1118](#1118))
([#2189](#2189))
([ba239fa](ba239fa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): devops docker prune removes stopped containers, unused networks and dangling images instead of failing on every engine

1 participant