将Docker-Machine与Amazon EC2集成 [英] Integrating Docker-Machine with Amazon EC2

查看:61
本文介绍了将Docker-Machine与Amazon EC2集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读这篇文章,向我展示如何在Amazon EC2之上配置Docker VM

I am reading this article which shows me how I can configure my docker VM on top of amazon ec2

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

我踏上了脚步

docker-machine create --driver amazonec2 aws01

但是现在我得到一个错误

but now I get an error

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

我用Google搜索并找到了该线程

I googled and found this thread

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

但是确实找到了对我有用的东西.

but did find anything which worked for me.

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

Has anyone been able to successfully create a VM on top of AWS using docker-machine?

推荐答案

我自己解决了这个问题.将答案放在这里

I solved it myself. putting the answer here

首先要做

aws configure

这将询问您一些问题,例如安全性ID和密钥.您应该能够从aws仪表板获取此信息.

This will ask you some questions like security id and key. you should be able to get this information from the aws dashboard.

aws ec2 describe-subnets

这将列出一堆子网信息.只需看看第一个,并记下AvailabilityZone和子网ID

This will list a bunch of subnet information. Just look at the first one and make note of AvailabilityZone and Subnet Id

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

在此处输入您在第二步中记下的子网ID,并且仅输入可用区的最后一个字符(因此,如果值是us-east-1c,则只需输入c)

Here enter the subnet ID you noted from step two and only the last character of the Availability Zone (so if the value is us-east-1c just enter 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

这篇关于将Docker-Machine与Amazon EC2集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆