我正在尝试在谷歌计算引擎上部署一台新的 docker 机器,但我不需要太多资源。只是一个简单的 nginx 服务器。
当我运行时:
$ docker-machine create --driver google --google-project my-project-name my-machine-name
它运行良好,但创建了一个 n1-standard-1
(1 个 vCPU,3.75 GB 内存) 实例,
但它有比我需要的更多的资源。
我还能够成功创建一个 g1-small
(1 个 vCPU,1.7 GB 内存) 实例。
但是当我尝试创建最小的实例 f1-micro
(1 个 vCPU,0.6 GB 内存) 它卡在了 Installing docker
我正在使用命令:
$ docker-machine create --driver google --google-project my-project-name --google-machine-type f1-micro my-machine-name
控制台输出:
Running pre-create checks...
(my-machine-name) Check that the project exists
(my-machine-name) Check if the instance already exists
Creating machine...
(my-machine-name) Generating SSH Key
(my-machine-name) Creating host...
(my-machine-name) Opening firewall ports
(my-machine-name) Creating instance
(my-machine-name) Waiting for Instance
(my-machine-name) Uploading SSH Key
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)...
Installing Docker...
对 docker 机器有最低要求吗?因为我找了找也没找到。 从我在 documentation 上的例子中看到的应该可以:
$ gcloud auth login
$ docker-machine create --driver google --google-project PROJECT_ID vm01
$ docker-machine create --driver google \
--google-project PROJECT_ID \
--google-zone us-central1-a \
--google-machine-type f1-micro \
vm02
我错过了什么吗? 谢谢。
最佳答案
好吧,它最终成功了,只是花了很长时间。
15-20 分钟 就我而言。 (3 台不同的机器)
关于Google Compute f1-micro 实例上的 Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37917047/