Skip to content

feat: never count the new and the installed build in image cleanup - #40

Merged
agentHits merged 1 commit into
AgentHits-Devfrom
claude/protect-downloaded-images-282be3
Oct 7, 2026
Merged

agentHits merged 1 commit into
AgentHits-Devfrom
claude/protect-downloaded-images-282be3

Conversation

@agentHits

Copy link
Copy Markdown
Collaborator

What changes

  • Image cleanup: the downloaded build and the build installed now always stay and are not counted. "Also keep N older" (0–5, default 1) applies only to the images behind them. Before, N included both, so the minimum was 3 and fewer meant risking the rollback build.
  • Rollback target: the update command records the running container's image id in DOKPLOY_PREVIOUS_IMAGE before docker service update; the startup cleanup in the new container protects it alongside the running image. If no id was recorded, the newest older image stands in for it. Malformed ids are ignored.
  • Setting moved to DOKPLOY_KEEP_OLD_IMAGES (off disables). An existing DOKPLOY_KEEP_IMAGES=0 meant "off" and must not be read as "keep none".
  • Images popover: protected rows are neutral (outline "New build" / "Installed now" badge, no number, no "frees"); only counted rows are numbered and coloured.
  • Update dialog header: full-width "Installed now" card with the complete fork build and official base. Version data refetches on open, and a build that is already installed is no longer offered as an update.

Testing

  • __test__/settings: 127 passed, including a new test that runs the generated cleanup script against a stub docker and checks which images get removed for keep 0/1/3 with and without a recorded previous image.
  • tsc --noEmit and biome clean.
  • Checked the popover visually on a temporary preview page (not committed).

🤖 Generated with Claude Code

"Keep the last N" used to count the downloaded build and the one running
now, so keeping fewer old images meant risking the rollback target, and
the smallest choice was 3.

Now both always stay and are not counted; N (0-5) applies only to the
older images behind them. The update command records the image of the
running container in DOKPLOY_PREVIOUS_IMAGE before replacing it, so the
startup cleanup in the new container knows which build to keep for a
rollback. Without a recorded id the newest older image stands in for it.

The setting moved to DOKPLOY_KEEP_OLD_IMAGES ("off" disables it): an
existing DOKPLOY_KEEP_IMAGES=0 meant off and must not read as "keep none".

The update dialog now shows the installed fork build and official base
in a full-width card, refetches it when opened, and stops offering a
build that is already installed (e.g. updated from another tab).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agentHits
agentHits merged commit b4201ff into AgentHits-Dev Oct 7, 2026
8 checks passed
@agentHits
agentHits deleted the claude/protect-downloaded-images-282be3 branch October 7, 2026 13:35
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.

1 participant