docker-machine create 出錯(cuò):Error with pre-create check

問(wèn)題

$ docker-machine create --driver virtualbox servm-1
Creating CA: /Users/username/.docker/machine/certs/ca.pem
Creating client certificate: /Users/username/.docker/machine/certs/cert.pem
Running pre-create checks...
(servm-1) Image cache directory does not exist, creating it at /Users/username/.docker/machine/cache...
(servm-1) No default Boot2Docker ISO found locally, downloading the latest release...
Error with pre-create check: "failure getting a version tag from the Github API response (are you getting rate limited by Github?)"

解決方案

我們可以google找到相應(yīng)的解決方案Solution

# If seeing:
#     (dev) No default Boot2Docker ISO found locally, downloading the latest release...
#     Error with pre-create check: "failure getting a version tag from the Github API response (are you getting rate limited by Github?)"
# then:
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso

創(chuàng)建docker-machine

$ curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso
$ docker-machine create --driver virtualbox servm-1
Running pre-create checks...
(servm-1) Unable to get the latest Boot2Docker ISO release version:  failure getting a version tag from the Github API response (are you getting rate limited by Github?)
Creating machine...
(servm-1) Unable to get the latest Boot2Docker ISO release version:  failure getting a version tag from the Github API response (are you getting rate limited by Github?)
(servm-1) Copying /Users/username/.docker/machine/cache/boot2docker.iso to /Users/username/.docker/machine/machines/servm-1/boot2docker.iso...
(servm-1) Creating VirtualBox VM...
(servm-1) Creating SSH key...
(servm-1) Starting the VM...
(servm-1) Check network to re-create if needed...
(servm-1) Found a new host-only adapter: "vboxnet1"
(servm-1) Waiting for an IP...
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 boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env servm-1

新的問(wèn)題

但是,當(dāng)我們執(zhí)行swarm時(shí),仍然有問(wèn)題

$ docker-machine ssh servm-1 "docker swarm init --advertise-addr 192.168.99.100"

Google出來(lái)的結(jié)果是Docker版本過(guò)低,還不能夠swarm,我可是最新版本啊??????!

于是,我ssh進(jìn)去,版本還真是低?。?!居然是2015年的,我的天。

$ docker-machine ssh servm-1
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015
Docker version 1.9.1, build a34a1d5

此時(shí)發(fā)現(xiàn),https://github.com/boot2docker/.../v1.9.1/boot2docker.iso,還真是1.9.1版本。

于是,下載了最新版本的boot2docker,并替換~/.docker/machine/cache/boot2docker.iso。

重新創(chuàng)建

$ docker-machine rm servm-1
About to remove servm-1
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed servm-1
$ docker-machine create --driver virtualbox servm-1
... ...
$ docker-machine ssh servm-1 "docker swarm init --advertise-addr 192.168.99.102"
Swarm initialized: current node (nha5c34sqeptxxej52fezljkf) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-07kfvclhdq6rqpgjomjcsmfcjd8l9q576ety8tuzetbscyxfhk-5rvcpmvto7zz0bswjixlzbjb7 192.168.99.102:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

參考

boot2docker
docker install on osx

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容