centos7.9 极简版 离线安装docker与docker-compose。资源整合。亲测可用

因为部分项目给的服务器是断网,并且是命令行极简安装的centos7。自己花了好久时间整理到的docker的所有依赖,本人亲测并且一直在用的安装方式。

一、安装步骤:

1.创建docker目录:

cd /usr/local/
mkdir docker
cd ./docker/

2.scp/sftp上传依赖文件至docker目录(步骤忽略)
3.执行安装命令:

rpm -Uvh libselinux-2.5-15.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh libselinux-python-2.5-15.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh libselinux-utils-2.5-15.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh libsemanage-2.5-14.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh libsemanage-python-2.5-14.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh libsepol-2.5-10.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh policycoreutils-2.5-34.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh policycoreutils-python-2.5-34.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh selinux-policy-3.13.1-268.el7.noarch.rpm --nodeps --nosignature
rpm -Uvh selinux-policy-targeted-3.13.1-268.el7.noarch.rpm --nodeps --nosignature
rpm -Uvh setools-libs-3.3.8-4.el7.x86_64.rpm --nodeps --nosignature
rpm -Uvh container-selinux-2.107-1.el7_6.noarch.rpm
rpm -ivh docker-ce-cli-19.03.8-3.el7.x86_64.rpm
rpm -ivh libseccomp-2.3.1-4.el7.x86_64.rpm
rpm -ivh libcgroup-0.41-21.el7.x86_64.rpm
rpm -Uvh containerd.io-1.2.6-3.3.el7.x86_64.rpm
rpm -ivh docker-ce-19.03.8-3.el7.x86_64.rpm
rpm -ivh docker-compose-plugin-2.10.2-3.el7.x86_64.rpm

4.安装docker-compose(此处docker-compose目录上传到了服务器的/usr/local/bin/docker-compose,根据自己上传的目录修改):

ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

5.测试是否安装成功:

docker-compose version
docker-compose version 1.27.3, build 4092ae5d 

如果显示Permission denied,则代表docker-compose命令权限不够。执行以下命令:

cd /usr/bin
chmod 777 docker-compose
sudo chmod +x /usr/local/bin/docker-compose

二、依赖包下载:

百度云下载链接:

链接:https://pan.baidu.com/s/1jsRPsMPFj60GBqxoSseIfw
提取码:p7my

你可能感兴趣的:(centos,docker,容器,运维,centos)