
基於 TLS 的 docker 守護程式正在 EC2 主機上執行。
docker 守護程式本地的 docker 用戶端運作正常,但docker-compose
出現以下錯誤:
$ export DOCKER_HOST=tcp://172.31.3.2:2376 DOCKER_TLS_VERIFY=1
ubuntu@ip-172-31-3-2:~$ docker --tls image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 8 months ago 1.84kB
ubuntu@ip-172-31-3-2:~$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 8 months ago 1.84kB
ubuntu@ip-172-31-3-2:~$ docker-compose -f jenkinsDocker/docker-compose.yml -p jenkins build
Building slavedotnet
ERROR: SSL error: HTTPSConnectionPool(host='172.31.3.2', port=2376): Max retries exceeded with url: /v1.21/build?q=False&pull=False&t=jenkins_slavedotnet&nocache=False&forcerm=False&rm=True (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:727)'),))
ubuntu@ip-172-31-3-2:~$
以下是建立伺服器憑證之前使用的設定檔。
{
"CN":"ec2-35-18x-xxx-xxx.ca-central-1.compute.amazonaws.com",
"hosts": [
"ec2-35-1xx-xxx-xxx.ca-central-1.compute.amazonaws.com",
"ip-172-31-3-2.ca-central-1.compute.internal",
"35.18x.xxx.xxx",
"172.31.3.2"
],
"Key": {
"algo": "rsa",
"size": 4096
},
"names": [
{
"C": "Canada",
"ST": "Saskatchewan",
"L": "Regina",
"O": "100000 Canada Inc.",
"OU": "Engineering"
}
]
}
這裡是docker-compose
工具的 yml 檔。
為什麼docker-compose
無法連線到 docker 守護程式?使用 TLS...