0

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

这是脚本(create-do):

#!/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 密钥。

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

4

2 回答 2

1

更新:2016 年 5 月 21 日今天早上再次出现同样的错误。试了4次,每次都以同样的方式失败。

更新:2016 年 5 月 20 日

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

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

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

于 2016-05-20T18:23:45.267 回答
0

这对我有用:

docker-machine provision your-node

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

我希望这有帮助!

于 2016-05-19T03:55:33.343 回答