-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docker shell/provisioning without SSH #4179
Comments
Hongli Lai here. I think it's better to wait a while before implementing anything, because the landscape is still moving quickly. From the research I've done so far, it does not look like it's viable to completely replace SSH with nsenter. The nsenter approach requires the binary to be installed on the host, which is not always the case. There are also certain use cases where SSH is more appropriate than nsenter. Most likely, in Baseimage-docker we will support both. The sanest approach would be to wait for Docker's native mechanism, which hasn't been implemented. |
And another issue with nsenter is: processes started by nsenter cannot be killed from within the container, even by root inside the container. Thus, their behavior is slightly different from when they're executed from within the container, or by SSH. It's not entirely clear whether it's ok to run arbitrary commands inside the container like this. Also, nsenter requires root on the Docker host. |
hi, However it is not clear to me what the functional difference is between:
please advise why/when prefer the one above the other? thanks! |
As for ssh vs nsenter, read these writeups in the baseimage-docker documentation: |
Thanks for the links, I had already read them but still have these questions: if I need access to the docker containers on a machine, I can use both docker attach (if on the same host) as SSH, as nsenter, to change or inspect stuff on that machine. I understand that SSH is a different beast because you use it mainly over the network. thanks! |
I think we can use |
+1 |
+1 for |
|
SSH is just overhead here if you can just use |
Was this actually addressed in #7377? |
No, it seems not possible to use the docker-exec as a replacemant to the |
This should be reopened @sethvargo |
@jgillich Hi! Closed issues are not tracked. If you are still having a problem, please open a new issue. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Currently, Vagrant can only provision or shell into a Docker container when it has an SSH daemon running.
Last month Docker's Jérôme Petazzoni wrote a post on the Docker blog titled "Why you don't need to run SSHD in your Docker containers". In it, he introduces a small tool called nsenter, which allows you to enter the namespace of a Docker container and run a program, such as a bash shell.
In the comments, Phusion's Hongi Lai, the creator of baseimage-docker, responds to the post:
Baseimage-docker is one of the more popular images to use with Vagrant, and Phusion were some of the most vocal advocates in favor of running SSHd inside docker containers.
Meanwhile, upstream, Docker is committed to creating a native mechanism to execute new processes in existing containers. It was slated for the 1.0 release but has since been delayed.
It'd be nice if Vagrant would allow for other mechanisms such as nsenter to provision or shell into containers.
The text was updated successfully, but these errors were encountered: