下载
docker官网,下载准备使用的rpm包
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
需要一下三个rpm文件包
一个selinux包:docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm
和docker包:docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
和依赖包:containerd.io-1.2.2-3.3.el7.x86_64.rpm
安装
按顺序执行:
yum localinstall containerd.io-1.2.2-3.3.el7.x86_64.rpm -y
yum localinstall docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm -y
yum localinstall docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm -y
设置开机启动和启动docker服务
systemctl enable docker
systemctl start docker
验证
验证docker是否成功安装
docker -v
docker-compose离线安装
下载
docker-compose github有下载地址
https://github.com/docker/compose/releases
安装
将下载可执行文件,放进系统
cp docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
验证
验证docker-compose是否成功安装
docker-compose -v