第 7 章 多主机管理 - 045 - 安装 Docker Machine
安装 Docker Machine
先安装docker
官方安装docker-machine的文档地址:https://docs.docker.com/machine/install-machine/
安装方法很简单,执行如下命令:
curl -L https://github.com/docker/machine/releases/download/v0.9.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine
赋予 docker-machine可执行的权限
chmod +x docker-machine
cp docker-machine /usr/local/bin/
查看docker-machine 的版本信息
docker-machine version
下载以下文件在https://github.com/docker/machine/tree/master/contrib/completion/bash/
docker-machine-prompt.bash
docker-machine-wrapper.bash
docker-machine.bash
将下载的completion scrip放置到 /etc/bash_completion.d 目录下。然后将如下代码添加到$HOME/.bashrc:
PS1="[\u@\h \W$(__docker_machine_ps1)]\$ "
或者执行脚本安装
先安装docker
#!/bin/bash
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo '
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
' > /etc/apt/sources.list sudo apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://53dc37d0.m.daocloud.io
systemctl restart docker.service
再安装docker-machine
#!/bin/bash
#Install Machine directly
version='v0.14.0'
base=https://github.com/docker/machine/releases/download/$version &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine docker-machine version #Install bash completion scripts
path=https://raw.githubusercontent.com/docker/machine/$version
for i in docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash
do
sudo wget "$path/contrib/completion/bash/${i}" -P /etc/bash_completion.d
done echo 'PS1="[\u@\h \W$(__docker_machine_ps1)]\$"' >> $HOME/.bashrc
source $HOME/.bashrc reboot
----------------------------引用来自----------------------------
https://mp.weixin.qq.com/s?__biz=MzIwMTM5MjUwMg==&mid=2653587738&idx=1&sn=22de0b8dab37557b6d496fa87695d36b&chksm=8d308103ba470815ff079521b5b1dd8f0624a6eedce74f3a65cfb601dffb886cc31fd9e50fdb&scene=21#wechat_redirect
第 7 章 多主机管理 - 045 - 安装 Docker Machine的更多相关文章
- 045、安装Docker Machine (2019-03-08 周五)
参考https://www.cnblogs.com/CloudMan6/p/7223599.html 前面我们的实验中只有一个docker host ,所有的容器都是运行在这一个host上的.但在 ...
- 安装 Docker Machine - 每天5分钟玩转 Docker 容器技术(45)
前面我们的实验环境中只有一个 docker host,所有的容器都是运行在这一个 host 上的.但在真正的环境中会有多个 host,容器在这些 host 中启动.运行.停止和销毁,相关容器会通过网络 ...
- centos7下安装docker(14安装docker machine)
之前我们做的实验都是在一个host上面的,其实在真正的环境中有多个host,容器在这些host上面启动,运行,停止和销毁,相关容器会通过网络相互通信,无论他们是否运行在相同的host上面. 对于这种歌 ...
- 第 7 章 多主机管理 - 046 - 创建 Machine
创建 Machine Machine 就是运行 docker daemon 的主机. “创建 Machine” 指的就是在 host 上安装和部署 docker. 创建第一个 machine: hos ...
- 第 7 章 多主机管理 - 047 - 管理 Machine
管理 Machine Docker Machine 则很简单 docker-machine env host1 显示访问 host1 需要的所有环境变量: 根据提示,执行 eval $(docker- ...
- 第二章、 Centos 6.8安装 Docker
2.1检查Docker的先决条件 64位 CPU计算机(x86_64),不支持32位 CPU 运行Linux 3.8 或更高版本内核. 内核必须支持一种合适的存储驱动(storage driver), ...
- 安装Docker Machine
什么是Docker Machine Docker Machine是Docker官方编排项目之一,由Go语言实现,负责在多种平台上快速安装Docker环境,Github项目主页 它支持Linux.Mac ...
- Docker多主机管理(八)--技术流ken
docker多主机管理 前面我们的实验环境中只有一个 docker host,所有的容器都是运行在这一个 host 上的.但在真正的环境中会有多个 host,容器在这些 host 中启动.运行.停止和 ...
- Docker Machine 管理-安装docker-machine(15)
前面我们的实验环境中只有一个 docker host,所有的容器都是运行在这一个 host 上的.但在真正的环境中会有多个 host,容器在这些 host 中启动.运行.停止和销毁,相关容器会通过网络 ...
随机推荐
- Linux维护常用命令
1.查看Linux占用内存/CPU最多的进程 可以使用以下命令查使用内存最多的10个进程 #ps -aux | sort -k4nr | head -n 10可以使用以下命令查使用CPU最多的10个进 ...
- bzoj 4810 由乃的玉米田 - bitset - 莫队算法
由乃在自己的农田边散步,她突然发现田里的一排玉米非常的不美.这排玉米一共有N株,它们的高度参差不齐. 由乃认为玉米田不美,所以她决定出个数据结构题 这个题是这样的: 给你一个序列a,长度为n,有m ...
- Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.
[root@web01 ~]# systemctl start php-fpm Job for php-fpm.service failed because the control process ...
- ODAC(V9.5.15) 学习笔记(四)TCustomDADataSet(5)
7.其他 名称 类型 说明 FindKey 类似于BDE的相关功能,在当前数据集中查找指定的记录 FindNearest 移动游标到最符合查找要求的第一条记录处 FindMacro 当前数据集中是否存 ...
- Linux电源管理_autosleep--(五)【转】
本文转载自:https://blog.csdn.net/wlsfling/article/details/46005409 1. 前言 Autosleep也是从Android wakelocks补丁集 ...
- CentOS 安装 Redis 笔记
Redis 安装 yum install redis -y 在启动 redis-server 之前,你需要修改配置文件/etc/redis.conf: 找到 bind 127.0.0.1,将其注释,这 ...
- git删除远程分支文件,不改变本地文件
git提交项目时候踩的Git的坑 特别 由于准备春招,所以希望各位看客方便的话,能去github上面帮我Star一下项目 https://github.com/Draymonders/Campus-S ...
- Eclipse和Tomcat使用过程的一些配置、错误等的总结记录
背景:公司项目使用jdk1.6.tomcat7.SVN,本文总结使用到现在的一些配置和问题. 1.Eclipse项目几点配置:(1)Windows -> Preferences -> Ja ...
- 关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset)
关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset) 2018-01-22 21:49:17 ...
- (转) Read-through: Wasserstein GAN
Sorta Insightful Reviews Projects Archive Research About In a world where everyone has opinions, on ...