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

Attach with "docker attach", not "docker exec -it" #363

Closed
jeanfbrito opened this issue Aug 8, 2018 · 8 comments
Closed

Attach with "docker attach", not "docker exec -it" #363

jeanfbrito opened this issue Aug 8, 2018 · 8 comments

Comments

@jeanfbrito
Copy link

To use binding.pry on Ruby on Rails, I need to access the same console that is already running.
Then, could be added a way to use the command docker attach containerid instead of the docker exec -it that opens another instance of the shell?
A setting to use it would solve my problem.
image

@PrashanthCorp
Copy link
Contributor

We open a new instance of the shell for most operations.
For example, here.

If that is what you want to change, we can log it under another issue.

@jeanfbrito
Copy link
Author

jeanfbrito commented Aug 9, 2018 via email

@StephenWeatherford
Copy link
Contributor

Would it be useful to have a separate menu item for both, or do you only want one or the other?

@jeanfbrito
Copy link
Author

jeanfbrito commented Aug 10, 2018 via email

@StephenWeatherford
Copy link
Contributor

Decision: provide both, something along these lines:
Attach via New Shell
Attach to Running Process

@bwateratmsft
Copy link
Collaborator

This will be possible as a user setting with #1596. Nevertheless we should investigate changing the default.

@bwateratmsft
Copy link
Collaborator

Thinking about this; changing the default is probably not a good idea. docker attach will attach to the original shell, whereas docker exec will create a new one. Arguably it should have always been docker attach, but a significant behavioral change could confuse people.

Given that the attach command can be customized, I'll close this. Command customization is the right option for those who want to use docker attach.

@bwateratmsft bwateratmsft removed this from the Future milestone May 20, 2020
@karolz-ms
Copy link
Contributor

There is a big difference between "injecting a shell into a running container" vs "attaching to stdin/stdout/stderr of the container's PID 1 process". I think we made the right choice exposing the former. If a lot of users ask for the latter, it should be a separate command.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants