---
title: "国产容器化离线安装"
author: "wangchen.ily"
date: "2025-06-17T17:17:28Z"
tags: []
categories: ["互联网"]
slug: "untitled"
draft: false
lastmod: "2025-06-18T12:13:58Z"
id: 2540279
url: "https://ily.iteye.com/blog/2540279"
---

#### 1、卸载旧版本（如有）

```
sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine
```

#### 2、离线下载

```
wget https://mirrors.huaweicloud.com/kunpeng/archive/compiler/bisheng_jdk/bisheng-jdk-8u262-linux-aarch64.tar.gz
wget https://github.com/containerd/containerd/releases/download/v1.7.24/containerd-1.7.24-linux-arm64.tar.gz
wget https://download.docker.com/linux/static/stable/aarch64/docker-27.5.1.tgz
wget https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-aarch64
```

#### 3、解压安装

```
# 解压到 /opt/docker
sudo mkdir -p /opt/docker
sudo tar -xzvf docker-27.5.1.tgz -C /usr/bin
sudo tar -xzvf containerd-1.7.24-linux-arm64.tar.gz -C /usr/bin
sudo tar -xzvf containerd-1.7.24-linux-arm64.tar.gz -C /usr/bin
sudo cp docker-compose-linux-aarch64 /usr/bin/docker-compose
# 添加到 PATH
echo 'export PATH=/opt/docker:$PATH' | sudo tee /etc/profile.d/docker.sh
source /etc/profile
```

#### 4、配置文件

 

```
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
```

 

#### 5、权限设置

 

```
chmod +x /usr/bin/docker-compose
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
```

#### 6、启动Docker

 

```
systemctl start docker
systemctl enable docker.service
```

 

#### 7、验证版本

 

```
docker -v
docker-compose -v
```

 

 

 

 

 

```

```