“docker工通过代理隧道运行hello-world”

Docker通过Openport.io隧道

我有一个Linux Docker主机设置和运行。 在笔记本电脑上,我可以直接向Docker主机发出命令(比如docker run hello-world )。

但是,现在我需要通过openport.io提供的隧道间接地向主机发出命令。

问题

假设Docker主机拥有IP 1.2.3.4,代理拥有IP 5.6.7.8。 该代理将3000映射到2376的常规Docker https端口。尝试使用代理时,我在我的笔记本电脑上遇到了这种情况:

 $ eval $(docker-machine env myhost) $ export HTTPS_PROXY="http://5.6.7.8:3000" $ docker run hello-world docker: error during connect: Post https://5.6.7.8:3000/v1.27/containers/create: x509: certificate is valid for 1.2.3.4, not 5.6.7.8. See 'docker run --help'. 

在守护端Dockerlogging这个消息:

 Jun 28 22:20:58 op dockerd[1145]: http: TLS handshake error from 127.0.0.1:51182: EOF 

尝试解决scheme1

我试过设置export HTTPS_PROXY="http://5.6.7.8:3000"

这在我的笔记本电脑上导致这个错误:

 docker: error during connect: Post https://5.6.7.8:3000/v1.27/containers/create: malformed HTTP response "\x15\x03\x01\x00\x02\x02\x16". 

守护进程的这个错误:

 Jun 28 22:23:10 op dockerd[1145]: http: TLS handshake error from 127.0.0.1:51198: tls: oversized record received with length 20037 

尝试解决scheme2

从我的笔记本上:

 $ docker -l debug --tlsverify=false run myip DEBU[0000] [hijack] End of stdout 

这在Docker主机上完全没有日志输出。

我的问题

  • 有没有一个正确的方式让docker容忍由代理引起的IP地址不匹配?
  • 有没有办法在客户端简单地禁用validation,所以它会容忍不匹配?