-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Explain how to be able to connect to the Docker API when using Vagrant? #2280
Comments
First, you have to edit Docker config file /etc/init/docker.conf (in Vagrant VM) like this:
Note the "-H=...", your Docker API will be available on port 4243. Restart Docker : stop docker
start docker My Vagrant VM starts with SSH port (22) forwarded to host 3222 port:
To be able to reach Docker API from host machine, create SSH tunnel :
(Enter your vagrant user password -- "vagrant" by default.)
-- this will list Docker containers. |
Hi @pyotr777 , thanks for helping me out! I modified
When I start my vagrant VM I don't see any messages about port forwarding:
So I assume that this means that SSH is on port 22? In any case, when I try to run the command:
(I'm entering "vagrant" as the password, and this problem happens whether or not I run this command as sudo.) I think this is just because I have the wrong password for root? When I try to run Edit: never mind, I figured out how to change
Is this what's supposed to happen? It does seem that I can connect to both 1024 and 4243 from within this newly-created ssh terminal:
And when I try to connect from within the terminal I get after calling But when I try to connect from my host plain old terminal:
What am I doing wrong? |
@pyotr777 Yes, that worked! Thanks for your help. You're a godsend. Do you think it'd be worthwhile to submit a PR that adds these details to the docs? |
Strictly speaking, Vagrant VM is not part of the Docker, and neither is SSH tunneling. |
Not in the docs, but a PR to a doc in contrib/vagrant/ would be useful. On Wed, Oct 23, 2013 at 8:46 AM, Peter notifications@github.com wrote:
|
Sorry if this issue could be best addressed by using StackOverflow, but for the past few days I've been having trouble trying to set up Docker such that I can connect to the remote API from my host machine.
I imagine this is pretty trivial to set up, but I can't find where this is documented and I think it should be mentioned in the installation docs for using Docker with Vagrant since it's probably a common use-case.
If someone can explain how it's supposed to be done, I'll be more than happy to document this myself.
The text was updated successfully, but these errors were encountered: