amazon-web-services - 将 Docker-Machine 与 Amazon EC2 集成

标签 amazon-web-services amazon-ec2 docker

我正在阅读这篇文章,它向我展示了如何在 amazon 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"
我用谷歌搜索并找到了这个线程

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

但确实找到了对我有用的任何东西。

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

最佳答案

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

先做

aws configure

这将询问您一些问题,例如安全 ID 和 key 。您应该能够从 aws 仪表板获取此信息。
aws ec2 describe-subnets

这将列出一堆子网信息。只需查看第一个并记下 AvailabilityZone 和 Subnet Id
docker-machine create --driver amazonec2 --amazonec2-subnet-id=xxxx --amazonec2-zone=c aws01

在此处输入您在第二步中记下的子网 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

关于amazon-web-services - 将 Docker-Machine 与 Amazon EC2 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37426933/

相关文章:

amazon-web-services - 当我可以在 S3 管理控制台中看到该文件时,为什么 AWS S3 返回 404?

ssl - 配置错误 : Elastic Load Balancer + EC2 + Route 53

docker - $'\r' : command not found with Docker Compose

amazon-web-services - SSH 到托管在 EC2 上的 docker 容器

amazon-web-services - codeBuild 容器如何在没有事先身份验证的情况下运行 aws-cli 命令?

amazon-web-services - Spark - Redshift -s3 : class path conflict

amazon-web-services - 使用 RetentionPeriodHours 时 Kinesis Stream CloudFormation 模板失败

EC2 上的 Python 多线程?

linux - 卡在连接到亚马逊 ec2 中的 us-west-2.ec2.archive.ubuntu.com

docker - sshd AuthorizedKeysCommand抛出状态127