2

I created a VirtualBox VM with Ubuntu 16 and Docker 17.12.0-ce, this docker host is named dockervm and it's listening on port 2373.

Now on a Windows machine (at prompt) I set DOCKER_HOST=tcp://dockervm:2373 and execute the command docker ps and I get:

error during connect: Get https://dockervm:2373/v1.35/containers/json: http: server gave HTTP response to HTTPS client

How can I remote control this docker host without secure docker host?


Now I tried to control de remote docker host via SSH (tutorial) but when I create the docker-machine I got this:

PS C:\Users\Roberto> docker-machine create --driver generic --generic-ip-address=192.168.15.115 --generic-ssh-key "c:/users/roberto/.ssh/id_rsa" --generic-ssh-user=jjw ubuntu
Running pre-create checks...
Creating machine...
(ubuntu) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with debian...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.15.115:2376": tls: oversized record received with length 20527
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

1 Answer 1

0

Solved.

  • First I changed the daemon to run in port 2375
  • Then I set the environment variable to DOCKER_HOST=<ip>:2375
  • Finally I was able to comunicate docker ps
1
  • Can you add a little bit more details? Commented Jul 2, 2018 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .