Repository navigation
Start the host helper from Berthward's own image - #14
Merged
Merged
Conversation
host started its short-lived privileged helper from a separate alpine:3.21 image, which had to be downloaded on first start, was pinned by hand and showed up as an orphan image on Unraid's Docker page. The helper only needs nsenter, which this image has, so it is now started from the container's own image. The separate helper image, its download at start and the Host Helper Image setting are gone; a template that still passes HOST_HELPER_IMAGE is ignored. The entrypoint looks the image up once and hands it on, and the command gets a plain environment instead of the image's.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
host <command>starts a short-lived privileged helper container that steps into the server's namespaces. That helper used a separate image,alpine:3.21:Change
The helper needs one program from its image,
nsenter, and Berthward's image has it. So the helper is now started from the image the container itself runs.host: starts the helper from the container's own image, withnsenterin place of the image's start command and without its health check. If the image cannot be found (no Docker socket), it stops with a clear message and exit status 69.self-image: prints the image ID of the container it runs in. The container's ID is read from/proc/self/mountinfo, so it works whatever the container's name or hostname is.BERTHWARD_SELF_IMAGE, so a host command from Claude or the Discord bridge does not ask Docker each time. A shell opened withdocker execlooks it up per command. The download of the helper image at start is gone.PATHandHOME, as it did with Alpine. Without this the image's locale setting reached the server's shell and made it print a warning on every command.HOST_HELPER_IMAGE=alpine:3.21; it is ignored, so existing installs switch over on update without an edit.The main container stays unprivileged, and the helper is as privileged as before; only the image behind it changed.
For existing installs
After updating, the
alpine:3.21image is no longer used and can be deleted, and the Host Helper Image field in the saved template does nothing and can be removed.docs/getting-started.mdsays so.Testing
tests/run.sh: ten new checks forhost(own image used, handed-on image used without a lookup, a handed-on value that is not an image ID is looked up again, the old setting is ignored, refusal with status 69 when the image cannot be found, usage error first, plain environment). All 489 pass, and the 129 bridge tests pass.nsenterruns as the entrypoint of the built image.hostcommand: 331–368 ms with the image handed on, against 331–353 ms with Alpine before.