2016-05-25 47 views
4

我读这篇文章,显示我怎么可以配置在Amazon EC2上的顶我的搬运工VM集成多克 - 机与Amazon EC2

https://docs.docker.com/machine/drivers/aws/

我到步骤

docker-machine create --driver amazonec2 aws01

,但现在我得到一个错误

Error with pre-create check: "unable to find a subnet in the zone: us-east-1a"

我用Google搜索,发现这个线程

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

但没有找到任何这为我工作。

是否有人能够使用docker-machine在AWS上成功创建VM?

回答

8

我自己解决了。把答案在这里

先做

aws configure 

这会问你喜欢安全ID和关键的一些问题。你应该能够从aws仪表板获取这些信息。

aws ec2 describe-subnets 

这将列出一堆子网信息。试想一下,在第一个,让AvailabilityZone和子网ID的音符

docker-machine create --driver amazonec2 --amazonec2-subnet-id=xxxx --amazonec2-zone=c aws01 

这里输入你从第二步指出子网ID,只有可用性区域的最后一个字符(所以如果值是美东 - 1C只是输入c)

现在你会看到

Running pre-create checks... 
Creating machine... 
(aws01) Launching instance... 
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... 
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 aws01 
+1

这是有益的。在我的情况下,我还必须在命令行上指定--amazonec2-vpc-id = ...。 – pvillela