设为首页 收藏本站
查看: 458|回复: 0

[经验分享] Use Docker Machine to provision hosts on cloud providers

[复制链接]

尚未签到

发表于 2018-5-29 11:14:21 | 显示全部楼层 |阅读模式
Docker Machine driver plugins are available for many cloud platforms, so you can use Machine to provision cloud hosts. When you use Docker Machine for provisioning, you create cloud hosts with Docker Engine installed on them.
You’ll need to install and run Docker Machine, and create an account with the cloud provider.
Then you provide account verification, security credentials, and configuration options for the providers as flags to docker-machine create. The flags are unique for each cloud-specific driver. For instance, to pass a Digital Ocean access token you use the --digitalocean-access-token flag. Take a look at the examples below for Digital Ocean and AWS.
Examples
Digital Ocean
For Digital Ocean, this command creates a Droplet (cloud host) called “docker-sandbox”.
  $ docker-machine create --driver digitalocean --digitalocean-access-token xxxxx docker-sandboxFor a step-by-step guide on using Machine to create Docker hosts on Digital Ocean, see the Digital Ocean Example.
Amazon Web Services (AWS)
For AWS EC2, this command creates an instance called “aws-sandbox”:
  $ docker-machine create --driver amazonec2 --amazonec2-access-key AKI******* --amazonec2-secret-key 8T93C*******  aws-sandboxFor a step-by-step guide on using Machine to create Dockerized AWS instances, see the Amazon Web Services (AWS) example.
The docker-machine create command
The docker-machine create command typically requires that you specify, at a minimum:

  • --driver - to indicate the provider on which to create the machine (VirtualBox, DigitalOcean, AWS, and so on)
  • Account verification and security credentials (for cloud providers), specific to the cloud service you are using
  • <machine> - name of the host you want to create
For convenience, docker-machine will use sensible defaults for choosing settings such as the image that the server is based on, but you override the defaults using the respective flags (e.g. --digitalocean-image). This is useful if, for example, you want to create a cloud server with a lot of memory and CPUs (by default docker-machine creates a small server).
For a full list of the flags/settings available and their defaults, see the output ofdocker-machine create -h at the command line, the create command in the Machine command line reference, and driver options and operating system defaults in the Machine driver reference.
Drivers for cloud providers
When you install Docker Machine, you get a set of drivers for various cloud providers (like Amazon Web Services, Digital Ocean, or Microsoft Azure) and local providers (like Oracle VirtualBox, VMWare Fusion, or Microsoft Hyper-V).
See Docker Machine driver reference for details on the drivers, including required flags and configuration options (which vary by provider).
3rd-party driver plugins
Several Docker Machine driver plugins for use with other cloud platforms are available from 3rd party contributors. These are use-at-your-own-risk plugins, not maintained by or formally associated with Docker.
See Available driver plugins in the docker/machine repo on GitHub.
Adding a host without a driver
You can add a host to Docker which only has a URL and no driver. Then you can use the machine name you provide here for an existing host so you don’t have to type out the URL every time you run a Docker command.
$ docker-machine create --url=tcp://50.134.234.20:2376 custombox$ docker-machine lsNAME        ACTIVE   DRIVER    STATE     URLcustombox   *        none      Running   tcp://50.134.234.20:2376Using Machine to provision Docker Swarm clusters
Docker Machine can also provision Docker Swarm clusters. This can be used with any driver and will be secured with TLS.

  • To get started with Swarm, see How to get Docker Swarm.
  • To learn how to use Machine to provision a Swarm cluster, see Provision a Swarm cluster with Docker Machine.
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-482545-1-1.html 上篇帖子: Get started with Docker Machine and a local VM 下篇帖子: centos 安装部署docker与局域网主机相通详细配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表