【问题标题】:docker-machine create with digitalocean driver and Ubuntu 16.04 x64 fails使用 digitalocean 驱动程序和 Ubuntu 16.04 x64 创建的 docker-machine 失败
【发布时间】:2016-05-17 18:03:12
【问题描述】:

我正在尝试在 Digital Ocean 上创建一个 docker 机器,但使用的是 16.04 LTS 而不是默认的 15.10。 do-access-token 文件包含我的令牌。

这是脚本(创建-执行):

#!/usr/bin/env bash
# Creates a digital-ocean server with Ubuntu 16.04 instead of the default
if [ "$1" != "" ]; then
echo "Creating: " $1
docker-machine                                          \
  create                                                \
  --driver digitalocean                                 \
  --digitalocean-access-token=`cat do-access-token`   \
  --digitalocean-image=ubuntu-16-04-x64             \
  --digitalocean-ipv6=true                          \
  $1
else
  echo "Must have server name!"
fi

当我像这样运行脚本时:

$ ./create-do ps-server

它成功地在 Digital Ocean 分配了机器,然后就这样扔了:

Creating:  ps-server
Running pre-create checks...
Creating machine...
(ps-server) Creating SSH key...
(ps-server) Creating Digital Ocean droplet...
(ps-server) Waiting for IP address to be assigned to the Droplet...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Error creating machine: Error running provisioning: Something went wrong 
running an SSH command!
command : sudo apt-get update
err     : exit status 100
output  : Reading package lists...
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

机器正在运行,但我无法访问它,因为在事情开始出错之前显然没有设置 SSH 密钥。

有人以前见过这个和/或有解决方法吗?

【问题讨论】:

    标签: docker digital-ocean ubuntu-16.04


    【解决方案1】:

    更新:2016 年 5 月 21 日 今天早上又因为同样的错误而坏了。尝试了 4 次,每次都以同样的方式失败。

    更新:2016 年 5 月 20 日

    根据 Digital Ocean 的支持,这是由于他们的 Ubuntu 16.04 映像存在问题,现已更正,我已确认现在可以正常工作。

    相关 GitHub 问题(尚未关闭):

    https://github.com/docker/machine/issues/3358

    【讨论】:

      【解决方案2】:

      这对我有用:

      docker-machine provision your-node
      

      我从这里采取了这个解决方案:https://github.com/docker/machine/issues/3358

      我希望这会有所帮助!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-12-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-04-26
        • 1970-01-01
        • 1970-01-01
        • 2017-03-08
        相关资源
        最近更新 更多