【问题标题】:Couldn't connect to the Docker daemon due to an SSL由于 SSL 无法连接到 Docker 守护程序
【发布时间】:2015-09-24 18:50:04
【问题描述】:

我正在尝试使用以下命令在 Google App/Compute Engine 上部署托管 VM (Python):

 gcloud --verbosity debug preview  app deploy ./app.yaml --set-default

在部署过程中创建了虚拟机实例,但它在出错时退出(这里是最后几行列表的粘贴):

DEBUG: Display disabled.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
DEBUG: Loaded Command Group: ['gcloud', 'compute', 'copy_files']
DEBUG: Detected docker environment variables: DOCKER_HOST=tcp://104.197.50.238:2376, DOCKER_CERT_PATH=../../../../../tmp/tmpPbKmOs, DOCKER_TLS_VERIFY=True
INFO: Starting new HTTPS connection (1): 104.197.50.238
DEBUG: Failed to connect to Docker daemon due to an SSL problem: [Errno 1] _ssl.c:523: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon due to an SSL problem.
Traceback (most recent call last):
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 591, in Execute
result = args.cmd_func(cli=self, args=args)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1191, in Run
resources = command_instance.Run(args)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/app_commands/deploy.py", line 208, in Run
implicit_remote_build)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/deploy_command_util.py", line 137, in BuildAndPushDockerImages
with docker_util.DockerHost(cli, version_id, remote) as docker_client:
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/docker_util.py", line 215, in __enter__
return containers.NewDockerClient(local=(not self._remote), **kwargs)
File "/home/zdenulo/bin/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 313, in NewDockerClient
'Couldn\'t connect to the Docker daemon due to an SSL problem.' + msg)
DockerDaemonConnectionError: Couldn't connect to the Docker daemon due to an SSL problem.
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the Docker daemon due to an SSL problem.

显然 SSL 有问题,但我不知道如何解决,我现在很绝望 :) 我有:

  • Docker 版本 1.8.2,构建 0a8c2e3
  • Boot2Docker-cli 版本:v1.8.0 Git 提交:9a26066
  • 谷歌云 SDK 0.9.79

应用 2015.09.23
应用引擎 java 1.9.26
应用引擎-python 1.9.26
bq 2.0.18
bq-nix 2.0.18
核心 2015.09.23
core-nix 2015.09.03
gcloud 2015.09.21
gsutil 4.15
gsutil-nix 4.14
预览 2015.09.21

  • OpenSuse 13.2
  • OpenSSL 1.0.1k-fips 2015 年 1 月 8 日

我非常感谢任何形式的帮助。

编辑:

app.yaml

module: default
runtime: python27
api_version: 1
threadsafe: yes
vm: true

resources:
  cpu: .5
  memory_gb: 1.3

manual_scaling:
  instances: 1

handlers:
- url: .*
  script: main.app

【问题讨论】:

  • 你的 app.yml 的内容是什么?
  • 我添加到描述中

标签: google-app-engine docker google-compute-engine managed-vm


【解决方案1】:

您是否在 OS X 上使用自制 Python?如果是这样,则 OpenSSL 和 Docker here 存在一个现有错误。

解决这个问题的最简单方法是临时使用带有系统 python 的 virtualenv。

pip install virtualenv
virtualenv ~/system-python-env
source ~/system-python-env
gcloud preview app deploy ...

【讨论】:

  • 您可以尝试安装 requests[secure] 看看是否成功/有帮助吗?
  • 我做了,但没有帮助
  • 嗯。它可能有很多事情。这可能是您的本地 boot2docker 的问题、python 和 openssl 版本的问题等。您可以尝试做gcloud preview app deploy app.yaml --set-default --docker-build=remote 以使用基于 GCE 的 docker 构建。您可以尝试使用 docker machine 而不是 boot2docker。您可以尝试使用 pyenv 进行独立的 python 安装。
  • 我尝试从我的 Macbook 进行部署并且它正在工作,所以看起来我的 Linux 上出现了一些问题,但谁知道呢? :) 无论如何感谢您的建议
【解决方案2】:

您可以使用“gcloud docker --authorize-only”获得短暂的 SSL。然后立即执行“gcloud preview app deploy..”。

gcloud docker --authorize-only
gcloud preview app deploy app.yaml --promote

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-12
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 2021-02-26
    • 1970-01-01
    • 1970-01-01
    • 2017-06-14
    相关资源
    最近更新 更多