[英]docker client (docker 1.12/centos) http: server gave HTTP response to HTTPS client
Set up docker 1.12 on centos 7. docker was started using systemd with the following commandline (according to systemctl status docker):在 centos 7 上设置 docker 1.12。 docker 是使用 systemd 和以下命令行启动的(根据 systemctl status docker):
/usr/bin/dockerd -D --tls=false --tlscert=/var/docker/server.pem --tlskey=/var/docker/serverkey.pem -H tcp://10.10.2.1:2376
then I want to check on the local machine, setting the following environment variables:然后我想检查本地机器,设置以下环境变量:
DOCKER_HOST=tcp://10.10.2.1:2376
DOCKER_TLS_VERIFY=0
DOCKER_MACHINE_NAME=default
Then checking with the docker commandline tool:然后使用 docker 命令行工具检查:
docker --tls=false --tlsverify=false images
results in:结果:
An error occurred trying to connect: Get https://10.10.2.1:2376/v1.24/images/json : http: server gave HTTP response to HTTPS client
尝试连接时发生错误:Get https://10.10.2.1:2376/v1.24/images/json : http: server given HTTP response to HTTPS client
Whereas a quick check:而快速检查:
curl http://10.10.2.1:2376/images/json
gives the images info.提供图像信息。
Now: I assume the server does respond to http, (which was intended), but how to get the client to talk http as well ?现在:我假设服务器确实响应了 http,(这是有意的),但是如何让客户端也与 http 通信呢?
It needs to explicitly define that your registry is not secure:它需要明确定义您的注册表不安全:
{
..
"insecure-registries" : [
"10.10.2.1:2376"
],
..
}
sudo service docker restart
see for details Docker: Test an insecure registry有关详细信息,请参阅Docker:测试不安全的注册表
Port 2376 is for TLS communication.端口 2376 用于 TLS 通信。 Use port 2375 instead.
请改用端口 2375。
DOCKER_HOST=tcp://10.10.2.1:2375
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.