在Ubuntu中设置Google Cloud Managed VM时发生DockerDaemonConnectionError [英] DockerDaemonConnectionError when setting Google Cloud Managed VM in Ubuntu

查看:136
本文介绍了在Ubuntu中设置Google Cloud Managed VM时发生DockerDaemonConnectionError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图根据本手册在Ubuntu中安装Google Cloud Managed VM: [1] [2]

我已经按照 Docker安装安装了Docker指导
$ b 运行Docker: sudo docker -H tcp://127.0.0.1:2376 -d

我已经根据 HTTPS Docker指南



我的环境变量:


  • DOCKER_HOST = tcp://:2376

  • DOCKER_TLS_VERIFY = 1

  • DOCKER_CERT_PATH = / home / eyalev / ca

  • $ b

    当我运行 gcloud预览应用程序安装托管-vms



    我得到一个错误:



    https://gist.github.com/eyalev / aab86463bc63f4319d5c

     追溯(最近一次调用最后一次):
    文件/ home / eyalev / Software /google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py,
    第153行,位于< module> main()文件/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py,
    第149行,在主_cli.Execute()文件/ home / / home / eyalev / Software中的文件eyalev / Software / google-cloud-sdk /./ lib / googlecloudsdk / calliope / cli.py,
    line 381,in Execute post_run_hooks = self .__ post_run_hooks,kwargs = kwargs) / home / eyalev / Software / google-cloud- sdk /./ lib / googlecloudsdk / calliope / backend.py,
    第887行,运行结果= command_instance.Run(args)文件/ home / eyalev / Software / google-cloud-sdk / lib / googlecloudsdk /appengine/app_commands/setup_managed_vms.py,
    第37行,运行setup_registry.SetupRegistry()文件/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images /setup_registry.py,
    第32行,在SetupRegistry中timeout = config.DOCKER_D_REQUEST_TIMEOUT)文件/ home / eyalev / Softw是/ google-cloud-sdk / platform / google_appengine / google / appengine / tools / docker / containers.py,
    第663行,在NewDockerClient'不能连接到docker守护进程使用指定的'google .appengine.tools.docker.containers.DockerDaemonConnectionError:

    无法使用指定环境
    变量连接到docker守护程序。请检查环境变量DOCKER_HOST,
    DOCKER_CERT_PATH和DOCKER_TLS_VERIFY设置是否正确。如果您使用boot2docker为
    ,请确保您已经运行$(boot2docker shellinit)

    有没有我缺少的东西?

    解决方案

    我最终得到了 gcloud preview app setup-managed- vms 在ubuntu上工作。以下是我必须做的:


    1. 获取docker 1.3.0,而不是1.3.1。 sudo apt-get install docker.io 在我的机器上安装了旧版本的docker,所以我必须先删除它。但 curl -sSL https://get.docker.com/ubuntu/ | sudo sh 安装版本1.3.1,这也不起作用。我在 https://get.docker.com/ubuntu/ 中重播了脚本中的每一行,但我必须更改最后一行 apt-get安装-y lxc-docker apt-get install -y lxc-docker-1.3.0 官方文档提到应用程序引擎没有使用boot2docker 1.3.1,但我认为它们意味着它不能用于docker 1.3.1。

    2. 我无法获得127.0.0.1作为我的主机名工作。创建ca和服务器证书时,必须使用 localhost

    3. 我必须导出 DOCKER_HOST = tcp:// localhost:2376 (注意使用localhost )以及 DOCKER_TLS_VERIFY = 1 DOCKER_CERT_PATH =<路径>

    4. $ b $我将/ etc / default / docker中的DOCKER_OPTS设置为 - tlsverify --tlscacert =<路径> /ca.pem --tlscert =<路径> /服务器-cert.pem --tlskey =<路径> /server-key.pem -H = 0.0.0.0:2376


    gcloud预览应用程序设置管理 - vms 现在可以使用,但我没有收到 gcloud预览应用程序运行为我的应用程序工作。


    I'm trying to install Google Cloud Managed VM in Ubuntu according to this manuals: [1], [2]

    I've installed Docker following the Docker installation guide.

    Running Docker with: sudo docker -H tcp://127.0.0.1:2376 -d

    I've created certificate keys according to the HTTPS Docker guide.

    My environments variables:

    • DOCKER_HOST=tcp://:2376
    • DOCKER_TLS_VERIFY=1
    • DOCKER_CERT_PATH=/home/eyalev/ca

    When I run gcloud preview app setup-managed-vms

    I get an error:

    https://gist.github.com/eyalev/aab86463bc63f4319d5c

    Traceback (most recent call last):
    File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py",
     line 153, in <module> main()   File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py",
     line 149, in main _cli.Execute()   File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py",
     line 381, in Execute post_run_hooks=self.__post_run_hooks, kwargs=kwargs)   File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py",
     line 274, in _Execute pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks)   File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py",
     line 887, in Run result = command_instance.Run(args)   File "/home/eyalev/Software/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/setup_managed_vms.py",
     line 37, in Run setup_registry.SetupRegistry()   File "/home/eyalev/Software/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/setup_registry.py",
     line 32, in SetupRegistry timeout=config.DOCKER_D_REQUEST_TIMEOUT)   File "/home/eyalev/Software/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py",
     line 663, in NewDockerClient 'Couldn\'t connect to the docker daemon using the specified ' google.appengine.tools.docker.containers.DockerDaemonConnectionError:
    
    Couldn't connect to the docker daemon using the specified environment
    variables. Please check the environment variables DOCKER_HOST,
    DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly. If you are
    using boot2docker, make sure you have run "$(boot2docker shellinit)"
    

    Is there something I'm missing?

    解决方案

    I finally got gcloud preview app setup-managed-vms to work on ubuntu. Here's what I had to do:

    1. get docker 1.3.0, not 1.3.1. sudo apt-get install docker.io installed and old version of docker on my machine, so I had to remove that first. But curl -sSL https://get.docker.com/ubuntu/ | sudo sh installs version 1.3.1, which also doesn't work. I replayed every line in the script at https://get.docker.com/ubuntu/ but I had to change the last line apt-get install -y lxc-docker to apt-get install -y lxc-docker-1.3.0 The official docs mention that app engine doesn't work with boot2docker 1.3.1, but I think they meant that it doesn't work with docker 1.3.1.

    2. I couldn't get 127.0.0.1 to work as my host name. I had to use localhost when creating the ca and server certificates.

    3. I had to export DOCKER_HOST=tcp://localhost:2376 (note the use of localhost) along with DOCKER_TLS_VERIFY=1 and DOCKER_CERT_PATH=<path>

    4. I set DOCKER_OPTS in /etc/default/docker to "--tlsverify --tlscacert=<path>/ca.pem --tlscert=<path>/server-cert.pem --tlskey=<path>/server-key.pem -H=0.0.0.0:2376"

    gcloud preview app setup-managed-vms works now, but I haven't gotten gcloud preview app run for my go app to work yet.

    这篇关于在Ubuntu中设置Google Cloud Managed VM时发生DockerDaemonConnectionError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆