Repository navigation
fix(docker): run tini as init so docker stop terminates the cli - #2191
Open
Hermsi1337 wants to merge 10 commits into
Open
Hermsi1337 wants to merge 10 commits into
Hermsi1337 wants to merge 10 commits into
Conversation
Install openssh-client and rsync, bind port forwardings to the container interface and document how to pass the ssh key. Closes #2182
Allocate a TTY only when interactive, fail on missing keys instead of creating a directory, make the key configurable, warn about host networking and document root-owned downloads. CI now checks that ssh, scp, ssh-keygen, rsync and GatewayPorts are in the image.
usermod printed "no changes" to stdout when MW_UID matched the mw user, which broke JSON output. Also drop lastlog/faillog so usermod does not create huge sparse files for large UIDs.
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.
Closes #2190
Stacked on #2189 (the entrypoint changes there), so the base is
feat/docker-host-uid.tiniand usetini -s -g -- /usr/local/bin/mw-entrypointas entrypoint.-gsends signals to the whole process group, so node behind the bash launcher (and e.g. the ssh child ofport-forward) gets them.-sregisters tini as subreaper, sodocker run --initkeeps working without tini's "not running as PID 1" warning on stderrdocker stopmust end the CLI with exit code 143 (SIGTERM) in root andMW_UIDmode. The uid check now looks at the node process viadocker top, since PID 1 is tini nowTested on arm64 with an image from this branch and the v1.28.1 tarball:
docker stop -t 10--initAlso checked:
docker kill -s INTgives 130, Ctrl-C in an interactive-itrun (withMW_UID) ends in 0.3s, exit codes propagate (unknown command gives 1),project list -o jsonpiping still gives clean JSON as root and withMW_UID=1000, and all CI docker steps pass as separatebash -eshells. The new stop check fails (137) against the same image without tini.After review: the entrypoint uses the absolute
/usr/bin/tini, the stop check waits until node is running instead of a fixedsleep(otherwise SIGTERM could hit the entrypoint shell and pass without testing anything), uses--time 10and cleans up via trap, and a new step checks thatdocker run --initkeeps stderr empty. Both checks fail against an image without tini resp. without-s.