一、docker离线安装
1、下载docker离线安装包
下载最新版本的 docker (或者选择自己想要安装的版本)到本地。
1)docker下载地址:Docker版本下载 || Docker-compose版本下载
docker版本按需选择,此处选最新,按需选择,切记此处选的是arm64架构的
https://download.docker.com/linux/static/stable/aarch64/
docker-compose下载(按需下载,此处用的是麒麟arm64系统,所以如下选择)
安装Docker
2.1 准备配置文件
需要提前准备一个Docker的配置文件
输入下列指令编辑配置文件:
sudo vim /etc/systemd/system/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 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
2.2 命令安装Docker和 Docker Compose
2.2.1 Docker 与 Docker Compose 手动安装配置指南
1)解压docker
tar xvf docker-28.2.2.tgz
2)将docker 文件移动到 /usr/bin 目录下
cp -p docker/* /usr/bin/
3)将ocker-compose-linux-aarch64 文件复制到 /usr/local/bin/ 目录下,并重命名为 docker-compose
cp docker-compose-linux-aarch64 /usr/local/bin/docker-compose
4)设置 docker-compose 文件权限
chmod +x /usr/local/bin/docker-compose
5)设置 docker.service 文件权限
chmod +x /etc/systemd/system/docker.service
重新加载配置文件
systemctl daemon-reload
2.2.1 启动Docker
使用下列命令启动docker
systemctl start docker
设置 docker 开机自启
systemctl enable docker.service
2.2.2 验证安装是否成功
使用下列的命令验证Docker安装是否成功
docker -v
版权声明
本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。