Skip to content

feat(packages): Docker apart from the System packages update - #14

Merged
inkly merged 4 commits into
mainfrom
feat/docker-apart
Oct 8, 2026
Merged

inkly merged 4 commits into
mainfrom
feat/docker-apart

Conversation

@inkly

@inkly inkly commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

The System packages update ran one apt upgrade of everything, and upgrading docker-ce or containerd.io restarts the Docker daemon: every container stops until it is back, and the ones with no restart policy stay stopped (measured on six machines, see CasaOS-Install#15). Nothing said so.

  • The check lists Docker on a line of its own: engine version, where it came from (Docker's repository, the distribution's docker.io, snap), what apt offers for its packages, and the command to type to update it by hand. The update list no longer carries Docker's packages.
  • The update installs the explicit list the check shows, minus Docker's (docker-ce, docker-ce-cli, docker-ce-rootless-extras, containerd.io, the buildx/compose/model plugins, docker.io, containerd): apt-get install --only-upgrade --no-install-recommends of names apt printed and that pass as package names, never concatenated unchecked into the unit's shell line. Before starting, a second simulation of exactly that list must change nothing of Docker's and remove nothing, otherwise the update is refused. If only Docker is left, it says so.
  • DPkg::Lock::Timeout=120, and one 'the box is being changed' check (a ReCasaOS update, an update of Docker, dpkg's lock held) guards the package update, the ReCasaOS update and the automatic updater, which starts nothing while it holds.

Unit tests for the new package pkg/dockerpkg run anywhere; the service tests need Linux (this PR's CI is their first run). The UI change follows in CasaOS-UI. Not in this PR: the guard on AppManagement's Docker root-directory route, and an 'Update Docker' action.

The update installed everything apt could upgrade, Docker's packages included, and
upgrading docker-ce or containerd.io restarts the Docker daemon: every container stops
until it is back, and the ones without a restart policy stay stopped.

The check lists Docker on a line of its own (version, where it came from, what apt offers,
the command to type to update it oneself), and the update installs the explicit list the
check shows, minus Docker's packages: --only-upgrade install of names apt printed and that
pass as package names, after a second simulation of exactly that list has been found to
change nothing of Docker's and to remove nothing. DPkg::Lock::Timeout=120.

One check of 'the box is being changed' (a ReCasaOS update, an update of Docker, a package
manager holding dpkg's lock) now guards the package update, the ReCasaOS update and the
automatic updater.
inkly added 3 commits October 8, 2026 20:14
…dings

The check on dpkg's lock used flock(1), whose lock apt and dpkg never see (they take POSIX
record locks), and counted any non-zero exit as held: on a host without dpkg it refused the
ReCasaOS update for ever. The lock is now probed with fcntl F_GETLK on the lock files, only
on a host that has dpkg, and tested against a lock held by another process.

Also: the manual command names every package the line lists; the family is excluded only on a
box that has a Docker engine; held and half-configured packages count as installed; the
simulations no longer hold the update's lock; the box is looked at again right before the unit
starts, and the unit itself simulates the list again right before it installs and installs
nothing if it now touches Docker or removes a package; a list that is no longer the checked
upgrades is a conflict; a refusal to start is not a failed attempt of the automatic updater;
'nothing to update' no longer blames Docker on a box without it.
…o protect

A box with no Docker engine (a Kubernetes node's containerd, say) keeps containerd.io in its
update, and the unit's own guard stops only on a removal there.
@inkly
inkly merged commit 2952510 into main Oct 8, 2026
1 check passed
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