Host de docker remoto via API sem HTTPS, somente HTTP

1

Eu criei uma VM do VirtualBox com o Ubuntu 16 e o Docker 17.12.0-ce, esse host do docker se chama dockervm e está escutando na porta 2373 .

Agora, em uma máquina Windows (no prompt), eu defino DOCKER_HOST=tcp://dockervm:2373 e executo o comando docker ps e recebo:

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

Como posso controlar remotamente este host do docker sem host de encaixe seguro ?

Agora eu tentei controlar o host remoto do docker via SSH ( tutorial ) mas quando eu crio o docker-machine eu tenho isso:

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.
    
por Beto Neto 27.02.2018 / 22:00

1 resposta

0

Resolvido.

  • Primeiro eu mudei o daemon para rodar na porta 2375
  • Depois, defino a variável de ambiente como DOCKER_HOST=<ip>:2375
  • Finalmente, consegui comunicar o docker ps
por 28.02.2018 / 15:50

Tags