Skip to content

fix: prevent Dozzle from attempting to update its own container#4600

Merged
amir20 merged 2 commits intomasterfrom
fix/prevent-self-update
Apr 7, 2026
Merged

fix: prevent Dozzle from attempting to update its own container#4600
amir20 merged 2 commits intomasterfrom
fix/prevent-self-update

Conversation

@amir20
Copy link
Copy Markdown
Owner

@amir20 amir20 commented Apr 6, 2026

Summary

  • Detect when Dozzle is trying to update its own standalone container (amir20/dozzle image)
  • Return an error with message to restart manually, since the image was already pulled
  • Swarm services are unaffected — the swarm orchestrator handles restarts externally

Test plan

  • Try updating Dozzle's own container in standalone mode — should get error message
  • Try updating Dozzle as a swarm service — should work as before
  • Try updating other standalone containers — should work as before

🤖 Generated with Claude Code

When running as a standalone container (not swarm), stopping Dozzle to
recreate it would terminate the update process. Instead, return an error
telling the user to restart manually since the image was already pulled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude bot commented Apr 6, 2026

  • Bug: c.Image == "amir20/dozzle" won't match the most common usage — users typically run amir20/dozzle:latest or via GHCR (ghcr.io/amir20/dozzle). Consider strings.Contains(imageName, "amir20/dozzle") using the already-resolved imageName variable instead of c.Image.

  • Minor: imageName (from inspectResp.Config.Image) is already available in scope and is the authoritative resolved image — prefer it over c.Image for the check for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@amir20 amir20 enabled auto-merge (squash) April 7, 2026 00:14
@claude
Copy link
Copy Markdown

claude bot commented Apr 7, 2026

  • strings.Contains(c.Image, "amir20/dozzle") could false-positive on images like myregistry.com/amir20/dozzle-fork. The original explicit check was safer; consider restoring c.Image == "amir20/dozzle" || strings.HasPrefix(c.Image, "amir20/dozzle:") and applying the same pattern in docker_service.go.
  • docker_service.go: Sending an error progress event and then returning an error may double-report the error to the frontend — verify UI handles this correctly.
  • No tests for the self-update guard path in UpdateContainer.

@amir20 amir20 merged commit f13bcdb into master Apr 7, 2026
12 checks passed
@amir20 amir20 deleted the fix/prevent-self-update branch April 7, 2026 00:18
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