Docker Community Forums

Share and learn in the Docker community.

Running docker in a windows vm like amazon ec2


(Sinjihn Smith) #1

I’m trying to run a docker container on a windows amazon ec2 server but I’m running into problems. I don’t think the installation can access localhost when I try to do boot2docker up. Are there any alternatives to boot2docker for windows or is there some way I can circumvent this problem?

For example, trying to do boot2docker -v up yields
.Connecting to tcp://localhost:2022 (attempt #0) over and over again.

docker version gives
Client version: 1.7.1 Client API version: 1.19 Go version (client): go1.4.2 Get http://127.0.0.1:2375/v1.19/version: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.. Are you trying to connect to a TLS-enabled daemon without TLS?

Is docker-machine an alternative to this? I’ve tried installing the docker-machine binary for win64bit but it doesn’t work. cURL installing also doesn’t actually install anything in the target folder but I’m not sure if these problems (w/the localhost one) are linked.


(Joe) #2

Hi,

Can you confirm if the “boot2docker-vm” VM has started successfully?

To check this, you can bring up the Oracle VM VirtualBox Manager GUI app and look for the status of the “boot2docker-vm” VM.

It is quite possible that the VM itself has not started, in which case, you will have to debug that first.

If it has started, then the problem is with the Docker daemon. Again, it is quite possible that the Docker daemon did not start successfully in the “boot2docker-vm” VM.

The Docker Client details that you see above are about the Windows Docker Client that has been installed and working well. It is not the Docker Client on the “boot2docker-vm” VM.

And let me try to answer your questions:

Are there any alternatives to boot2docker for windows or is there some way I can circumvent this problem?
Ans: I do no think there is any alternative to boot2docker for Windows at this time. Docker Inc., folks, please confirm this. And there is no way to circumvent this issue. But I think this can be solved by debugging.

Is docker-machine an alternative to this?
Ans: My guess is that, if you can’t get “boot2docker” to work, you won’t be able to get docker-machine to create Docker hosts on your Amazon EC2 Windows instance.

-Joe


(Sinjihn Smith) #3

boot2docker-vm says running in the VBox GUI, so it has started successfully (surprisingly unlike in windows access)

How would I go about debugging this if it isn’t a vbox issue? I have a feeling that it has something to do with internet or localhost access, mainly because of the attempt to connect to localhost. When vbox isn’t running properly I see an error like it starts and then it exits immediately afterwords with some status code.

Since vbox is working I thought docker-machine should be able to create docker hosts, but cURL installing it doesn’t work which is the only way available right now according to the docs for windows, leading me to think the two issues are linked. Because yes, you’re right I think. If it isn’t an issue with Vbox then there’s something else under the hood that’s debuggable, I think.


(Joe) #4

Ok, good. So it is not a boot2docker-vm startup issue. It is probably something to do with the Docker install on the boot2docker-vm.

Do a boot2docker ssh on the EC2 Windows Instance to ssh onto the boot2docker-vm. If that does not work, bring up the console via the VBox interface.

Once you have successfully sshed onto the boot2docker-vm, you can debug the Docker installation.

Issue a “docker version” command first to confirm that Docker has been installed properly. Let me know what you see.

Cheers,
Joe


(Sinjihn Smith) #5

boot2docker -v ssh


Boot2Docker-cli version: v1.7.1
Git commit: 8fdc6f5
2015/08/14 15:29:24 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo boot2docker-vm --machinereadable
2015/08/14 15:29:24 executing: C:\Program Files (x86)\Git\bin\ssh.exe   ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 2022 -i C:\Users\Administrator\.ssh\id_boot2docker docker@localhost

Then it hangs for a bit, then

error in run: exit status 255

docker version


PS Z:\nudger-meteor> docker version

Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): windows/amd64
Get http://127.0.0.1:2375/v1.19/version: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because thetarget machine actively refused it.. Are you trying to connect to a TLS-enabled daemon without TLS?

When I look at the VBox manager, I see that in the preview for the VM the boot2docker whale thing shows up. The virtual machine says “running”, Linux 2.6/3.x (64-bit)


(Joe) #6

Hi,

Could you goto the VBOX interface, right click on that VM, shut it down and restart it, then open a console there and see if Docker has been started?

Basically, bypass the boot2docker way of starting up and "ssh"ing and use the VBOX interface and see how that goes.

-Joe