Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Ctrl-C no longer works in Docker images #1089

Open
RalfJung opened this issue Dec 21, 2022 · 6 comments
Open

Ctrl-C no longer works in Docker images #1089

RalfJung opened this issue Dec 21, 2022 · 6 comments

Comments

@RalfJung
Copy link
Contributor

RalfJung commented Dec 21, 2022

Between r22.09.27 and r22.12.03, Ctrl-C stopped working in josh docker images:

$ docker run -it -p 8000:8000 -e JOSH_REMOTE=https://github.com -e JOSH_EXTRA_OPTS=--no-background -v josh-vol2:/data/git joshproject/josh-proxy:r22.09.27
(wait until it has started)
(hit Ctrl-C)
(it quits as one would hope)

but

$ docker run -it -p 8000:8000 -e JOSH_REMOTE=https://github.com -e JOSH_EXTRA_OPTS=--no-background -v josh-vol2:/data/git joshproject/josh-proxy:r22.12.03
(wait until it has started)
(hit Ctrl-C)
(nothing happens)

I also see a lot of new log messages from s6-rc so that is probably related.

This is quote annoying for the case of running josh locally to port commits back and forth between the monorepo and a subrepo. Here josh does not run permanently, it is only started when syncing. Now I have to open another terminal, do docker container ls, find the right container, copy-paste its ID, and run docker container stop $ID -- and I have to write docs explaining all that so that other people can also do the josh sync. Things were much easier when Ctrl-C worked as expected. Would be nice to see this fixed. :)

@vlad-ivanov-name
Copy link
Collaborator

It’s true that it’s related to the new service manager. To avoid the need to open another terminal tab, you can run sh or bash in the container (by appending the command to your docker run command line) and then send CTRL-D to trigger shutdown

@RalfJung
Copy link
Contributor Author

RalfJung commented Jan 2, 2023

So docker run -it -p 8000:8000 -e JOSH_REMOTE=https://github.com -e JOSH_EXTRA_OPTS=--no-background joshproject/josh-proxy:latest bash? Interesting trick, yeah that seems to work, thanks!

@vlad-ivanov-name
Copy link
Collaborator

As a side note, wouldn’t it be better if you hosted a josh instance available to everyone who needs it to work with that specific repo? Then users could just use that

@RalfJung
Copy link
Contributor Author

RalfJung commented Jan 2, 2023

Very few people need to do syncing, and hosting a server would require someone to do all the maintenance for that. That's just a lot of work that I personally don't have time for, and doesn't seem worth bothering the Rust infra team for.

Also authenticating pushing would be even harder then, I think?

@vlad-ivanov-name
Copy link
Collaborator

Push authentication can be done with github personal tokens. Developers can issue a separate token for use with josh and store it securely using git-credential-manager. That is, until SSH support for push is implemented

@RalfJung
Copy link
Contributor Author

RalfJung commented Jan 2, 2023

I don't think I would be comfortable handing a personal token (that is valid for all repos) to such a server. Even less would I want to give it access to my ssh agent (which would let it use my keys to authenticate against anything).

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

No branches or pull requests

2 participants