环境准备
1、需要会一点点Linux基础
2、Centos7
3、XShell连接服务器进行远程操作
| 序号 | 主机名 | IP | 操作系统 |
| 1 | node01 | 192.168.56.121 | Centos 7.5 |
| 2 | node02 | 192.168.56.122 | Centos 7.5 |
| 3 | node03 | 192.168.56.123 | Centos 7.5 |
| 4 | node04 | 192.168.56.124 | Centos 7.5 |
环境检查
# 系统内核是 3.10以上的
[root@node01 ~]# uname -r
3.10.0-862.el7.x86_64
# 系统版本
[root@node01 ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@node01 ~]#
安装部署
# 卸载旧的docker
[root@node01 /]# yum remove docker \
> docker-client \
> docker-client-latest \
> docker-common \
> docker-latest \
> docker-latest-logrotate \
> docker-logrotate \
> docker-engine
Loaded plugins: fastestmirror
No Match for argument: docker
# 构建一个容器
docker build
# 拉取一个容器
docker pull
# 运行一个容器
docker run