Because the work needs to deploy k8s cluster offline on the Galaxy Kirin v10 system, the premise of k8s deployment is to have a docker environment, so it is inevitable to install docker offline.
Table of contents
1. Download the docker package
2. Unzip docker and grant execution permission
3. Edit the system service file of docker
4. Add execution permission to docker.service
1. Download the docker package
Address: Index of linux/static/stable/aarch64/
Choose the appropriate version, I downloaded 20.10.7
Choose the path where you place the docker package for decompression:
cd /home/huawei/zq
tar -zxvf docker-20.10.7.tgz
2. Unzip docker and grant execution permission
chmod +x ./docker/*
Copy all executable files under the docker folder to /usr/bin/:
cp /home/zq/docker/* /usr/bin/
3. Edit the system service file of docker
vi /usr/lib/systemd/system/docker.service
Copy the content below into the docker.service file you just created
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
4. Add execution permission to docker.service
chmod +x /usr/lib/systemd/system/docker.service
and:
systemctl daemon-reload
5. Start dockerd
cd /usr/bin
implement:
dockerd
6. Edit daemon.json
vi /etc/docker/daemon.json
and add the following:
{
"registry-mirrors": ["https://registry.docker-cn.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
and execute:
systemctl daemon-reload
ps: If you are connected to the Internet, it is recommended to replace the address of the warehouse mirror with the address of the domestic Alibaba Cloud warehouse. The official address is basically inaccessible when connected to the Internet.
Start docker:
systemctl start docker
Self-starting at boot:
systemctl enable docker
7. Verify docker
Check the docker version:
docker -v
View docker detailed version information:
docker version
View docker related information:
docker info
8. At this point, the docker binary package is completed, and the next step can be performed. The next article will complete the offline deployment of k8s.