Major release. Closes the "lost on recreate" bug class that's been bleeding patch-releases for weeks.
Why this matters
When Docksentry's compose-path can't see the host compose file (Docksentry runs in its own container, host compose dirs not mounted — the common deployment), it falls back to standalone docker run recreate from inspect data. That fallback was silently dropping:
- Network aliases — compose service hostnames (
db,redis,broker,app) → Paperless-NGX, Nextcloud went into restart-loops because companion services in the same stack hit NXDOMAIN - Fixed IPs, MAC, links — multi-network setups lost extra networks entirely
- All resource limits — memory, CPU, pids, oom, blkio, ulimits, group-add
- Lifecycle — stop-signal, stop-timeout, auto-remove
- Process config — working-dir, domainname, tty, stdin
- Healthcheck overrides — compose
healthcheck:directives ignored - Image-CMD lock-in — old image's CMD restored on every update, blocking image releases that change CMD
What's fixed
Network state (the core bug)
--network-aliasfor each compose-service alias on the primary network--ip/--ip6fromIPAMConfig--mac-addressfromConfig.MacAddress--linkfor legacy links- New
_attach_extra_networks()helper:docker network connectfor additional networks (multi-network compose pattern)
Resource limits (Compose-typical)
--memory,--memory-swap,--memory-reservation,--memory-swappiness--cpus,--cpu-shares,--cpu-period,--cpu-quota,--cpuset-cpus,--cpuset-mems,--cpu-rt-period,--cpu-rt-runtime--pids-limit--oom-score-adj,--oom-kill-disable--blkio-weight--ulimit name=soft:hard--group-add
Lifecycle + process
--auto-remove(when no restart policy)--stop-signal,--stop-timeout--workdir,--domainname-t(tty),-i(stdin)- Full healthcheck override:
--health-cmd,--health-interval,--health-timeout,--health-start-period,--health-start-interval,--health-retries,--no-healthcheck
Image-aware Cmd/Entrypoint
_build_run_args() gained an optional image_defaults parameter. When provided, Container-level Cmd / Entrypoint are restored only when they actually differ from the image's defaults. Both the regular update path and the selfupdate helper now fetch + pass it. Result: image updates that change CMD or ENTRYPOINT no longer get blocked by the old image's tokens.
Audit-mode safety net
New debug-only _audit_inspect_coverage() walks each container's inspect dict before recreate and logs [audit] HostConfig.<key> / [audit] Config.<key> for any non-default value not honored and not intentionally skipped. Future Docker versions adding new keys will surface here instead of being silently dropped — turning the next "lost on recreate" bug from user-discovered into self-discovered. Enable with DEBUG=true in env.
Empirically verified
Built run args from a synthetic Nextcloud-style compose container (multi-network, memory/CPU/pids limits, ulimits, healthcheck override, working-dir, stop-signal) and confirmed:
--network-alias apprendered correctly- Container-name and short-id Aliases auto-filtered out (Docker re-adds them)
- All 17+ resource and config fields present
Cmdsuppressed when matching image default- Backward-compatible without
image_defaults(legacy callers untouched)
Backward compatibility
_build_run_args(config, image, name, image_defaults=None)— fourth arg optional, defaultNonepreserves pre-v1.19.0 Cmd-restore behaviour- No env vars added or changed
- No existing field stops working
- Existing setups:
docker pull amayer1983/docksentry:latest+docker compose up -dis enough
Why v1.19.0 not v1.18.14
Multiple behavioural changes for compose-container recreate (network aliases now preserved, resource limits now preserved, healthcheck overrides now preserved). All changes are in the "restore more state than before" direction — no field that worked before is dropped — but the recreated container surface area is meaningfully larger, so a minor bump is more honest than a patch bump.
Upgrade
docker pull amayer1983/docksentry:latest
docker compose up -d