docker-machine
docker-machine
- 查看可用镜像
docker-machine ls
- 建立一个节点
[root@localhost tmp]# docker-machine create --driver virtualbox default
[root@localhost tmp]# docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet0"
(default) Waiting for an IP...
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 boot2docker...
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 default
(如果系统没有预先安装好boot2docker,需要FQ下载该镜像。)
[root@localhost tmp]# proxychains4 wget https://github.com/boot2docker/boot2docker/releases/download/v17.06.2-ce/boot2docker.iso[root@localhost tmp]# cp boot2docker.iso /root/.docker/machine/cache/
- 显示可用的节点
docker-machine ls
[root@localhost tmp]# docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v17.06.2-ce
- 告知 Docker 去 联系新的机器
[centos@localhost tmp]$ docker-machine env
Error checking TLS connection: machine does not exist
[centos@localhost tmp]$ sudo -s
[sudo] password for centos:
[root@localhost tmp]# docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/root/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env)
[root@localhost tmp]# eval $(docker-machine env)
- 获取节点的ip地址
docker-machine ip default
[root@localhost tmp]# docker run -d -p 8000:80 nginx
[root@localhost tmp]# curl $(docker-machine ip default):8000
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>body {width: 35em;margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p><p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p>
</body>
</html>
- 停止一个节点
[root@localhost tmp]# docker-machine stop
Stopping "default"...
Machine "default" was stopped.
转载于:https://www.cnblogs.com/Ethan2lee/p/7508442.html
docker-machine相关推荐
- centos7下安装docker(14安装docker machine)
为所有host安装和配置docker 之前我们手工安装了一个docker host: 1.安装https CA证书 2.添加GPG key 3.添加docker apt源 4.安装docker ...
- Docker Machine 简介
Docker Machine 是什么? Docker Machine 是 Docker 官方提供的一个工具,它可以帮助我们在远程的机器上安装 Docker,或者在虚拟机 host 上直接安装虚拟机并在 ...
- Docker(五):Docker 三剑客之 Docker Machine
上篇文章Docker(四):Docker 三剑客之 Docker Compose 介绍了 Docker Compose,这篇文章我们来了解 Docker Machine . Docker Machin ...
- docker——三剑客之Docker Machine
Docker Machine是Docker官方三剑客项目之一,负责使用Docker的第一步,在多种平台上快速安装Docker环境. 它支持多种平台,让用户在很短时间内搭建一套Docker主机集群. M ...
- 用 Docker Machine 创建 Azure 虚拟主机
搭建环境向来是一个重复造轮子的过程,Docker Machine 则把用户搭建 Docker 环境的各种方案汇集在了一起.笔者在<Docker Machine 简介>一文中演示了使用 Do ...
- couchbase_适用于具有Couchbase和WildFly的多容器和多主机应用程序的Docker Machine,Swarm和Compose...
couchbase 该博客将说明如何使用Docker创建部署在多个主机上的多容器应用程序. 这将使用Docker Machine,Swarm和Compose实现. 是的,这三个工具一起使这个博客变得更 ...
- 适用于具有Couchbase和WildFly的多容器和多主机应用程序的Docker Machine,Swarm和Compose...
该博客将说明如何使用Docker创建部署在多个主机上的多容器应用程序. 这将使用Docker Machine,Swarm和Compose实现. 是的,所有这三个工具一起使此博客更加有趣! 该图说明了关 ...
- re.containerbase.startinternal 子容器启动失败_Python项目容器化实践(二) Docker Machine和Docker Swarm...
前言 这篇文章介绍Docker生态中的常被提到的Engine.Machine和Swarm,大家以了解为主,工作需要再深入. Engine Docker Engine其实就是我们常说的「Docker」, ...
- Docker Machine搭建并加入节点
对于集群服务器来讲,要在每台机器上手动安装Docker是一件及其痛苦的事情,还好有Docker Machine这一工具,Docker三剑客中的一角. 一.Docker Machine介绍 这个工具已经 ...
- 安装 Docker Machine
安装 Docker Machine Docker Machine 支持 Windows ,OS X ,和 Linux,并且被安装为一个独立的二进制文件.用于各平台架构的二进制文件链接如下: Windo ...
最新文章
- 容器 root权限运行_【漏洞通告】Containerd容器逃逸漏洞通告 (CVE202015257)
- 19.1 Linux监控平台介绍;19.2 zabbix监控介绍;19.3,19.4 安装zabbi
- 皮一皮:人生就像编程,总有防不胜防的bug会被人发现...
- 小议IndexedDB中的主要对象
- Boost.MultiIndex 使用随机访问索引的示例
- 【Qt】QModbusRtuSerialMaster类
- RFC remote call during status filter logic
- python 过滤相似图片_求教 python 网站爬虫过滤出图片 url 的问题
- 字符串匹配之KMP(KnuthMorrisPratt)算法(图解)
- Android表格拖拽排序,Android 拖拽排序控件 DragGridView
- Mr.J--正则表达式
- Java案例实现用户登录
- 植被覆盖指数计算教程(ENVI)
- matlab中fprintf整数,matlab中fprintf函数的用法
- 值得收藏的199条经典民间偏方
- 前端常识:常见显示器屏幕分辨率
- React-router 嵌套路由传值(render和children)
- c++ grpc compress(deflate算法) demo编译
- iPhone机型适配相关问题
- 手机 App 的技术栈