Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

server: add option to stay in foreground #1108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkoelker
Copy link

Adds an option (-D) to prevent forking into the background. Allows running mosh-server directly as a docker ENTRYPOINT[1]. The server can then be specified to use the container like:

mosh --server='function s() { CONTAINER=$((docker inspect --format={{.Id}} mosh 2> /dev/null || docker run -dti --rm -v /var/run/docker.sock:/var/run/docker.sock --name mosh --net=host jkoelker/mosh-server new -D -@ "$@") | sed '/^$/d') ; docker logs "${CONTAINER}"; }; s' [user@]host [command...]

This is particularly useful to mosh'ing into GCP Container-Optimized where the filesystem is readonly.

Fixes #1091

[1] https://github.com/jkoelker/dockerfiles/blob/mosh-server/Dockerfile#L32

msva added a commit to alphallc/mosh that referenced this pull request Jun 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to run mosh-server in the foreground
1 participant