银河麒麟国产化系统(或者是Linux)一键安装docker和docker-compose

在国产化化机器上离线安装docker和docker-compose

第一步,查询国产化系统的cpu架构

使用如下命令都可以查询出来:

# 查询全部
uname -a
# 只查询部分
uname -p
# 查了cpu 列表
lscpu

 查询示例如下:

为麒麟桌面版

为麒麟服务版

第二步,离线下载相对应的安装包

docker下载地址:docker-ce-linux-static-stable安装包下载_开源镜像站-阿里云

 或是是这个地址:Index of linux/static/stable/

哪个地方方便就选择哪个即可! 

选择一个稳定一点的版本下载即可,当前选择的是20.10.18的版本

下载前可以查询一下对应的版本!

下载docker-compose地址:https://github.com/docker/compose/releases

根据cpu 选择对应的版本点击下载即可! 

第三步,使用一键安装命令,安装docker

创建一个docker文件夹,把这些文件都放在一个文件夹中,最后文件夹下内容如下:

创建install.sh文件,文件内容如下(若是下载的版本不同,需要修改文件内容):

#docker 安装 若是下载的docker版本不同,需要修改下面一行即可
tar -zxvf ./docker-20.10.18.tgz
scp docker/* /usr/bin/
scp docker.service /etc/systemd/system/
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker.service
# 启动docker
systemctl start docker 
# 开机自启动
systemctl enable docker

#docker-compose安装
sudo mv docker-compose /usr/bin/
sudo chmod +x /usr/bin/docker-compose

创建docker.service文件,文件内容如下:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
  
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --selinux-enabled=false --insecure-registry=127.0.0.1
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
  
[Install]
WantedBy=multi-user.target

最后把这个文件夹上传到国产化主机中,例如:/soft/docker

授权这个install.sh安装文件:

chmod -R 777 install.sh

执行这个文件:

./install.sh

就会进行安装!等待安装完成即可!应该是可以兼容CentOS7和麒麟系统的!

第四步,查看安装内容

使用如下命令查看

docker -v
docker-compose -v
systemctl status docker

至此!国产化系统中 docker 离线安装完成! 

Docker 相关内容记录-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值