文章目录
- 一、在线安装
- 二、联网下载软件
- 2.1. 下载rpm
- 2.2. 安装 docker
- 2.3.测试验证
一、在线安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyunsystemctl enable docker
systemctl start docker# 下载docker-compose(win下载更快)
https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64# 国内下载
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/bin/docker-compose
chmod a+x /usr/bin/docker-compose
二、联网下载软件
找一台可以上网的虚拟机把需要的软件提前下载下来
2.1. 下载rpm
sudo yum install -y --downloadonly --downloaddir=$PWD/devel yum-utils device-mapper-persistent-data lvm2
sudo yum install -y devel/*.rpm
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y --downloadonly --downloaddir=$PWD/docker docker-ce
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ./docker-compose
2.2. 安装 docker
把刚才下载好的devel文件夹、docker文件夹、docker-compose文件复制到这台无望连接外网的虚拟机上
sudo yum install -y devel/*.rpm
sudo yum install -y docker/*.rpm
systemctl enable docker
systemctl start docker
chmod a+x ./docker-compose
cp ./docker-compose /usr/bin/
2.3.测试验证
docker info
docker-compose -version