Kno*_*uch 4 amazon-ec2 amazon-web-services docker
我正在阅读这篇文章,它向我展示了如何在亚马逊ec2上配置我的docker VM
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?
Kno*_*uch 11
我自己解决了.把答案放在这里
先做
aws configure
Run Code Online (Sandbox Code Playgroud)
这会问你一些安全ID和密钥等问题.您应该能够从aws仪表板获取此信息.
aws ec2 describe-subnets
Run Code Online (Sandbox Code Playgroud)
这将列出一堆子网信息.只需查看第一个并记下AvailabilityZone和Subnet Id即可
docker-machine create --driver amazonec2 --amazonec2-subnet-id=xxxx --amazonec2-zone=c aws01
Run Code Online (Sandbox Code Playgroud)
在此处输入您在步骤2中记下的子网ID,并且仅输入可用区的最后一个字符(因此,如果值为us-east-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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
904 次 |
| 最近记录: |