(1) Kirin system (arm64/aarch64) install docker and docker-compose offline

foreword

Recently, the company needs to deploy all services to Kylin servers, including various servers: nginx, redis, emqx, influxDB, kafka, zookeeper, minio, mysql, and various applications.

I have been exposed to rain, so I also want to hold an umbrella for others. There is very little information on the arm64 system on the Internet, and it took a lot of trial and error. So write down all these things in summary, hoping to help the students in the future.

1. Preparation

1. Prepare the server account (the root account is used throughout this process)

(因为是第一次安装这玩意儿,尽量使用root账号,避免操作的时候碰到一些权限问题)

2. Check the operating system version

[root@ArmServer docker]# uname -a
Linux ArmServer.XHKJ 4.19.90-24.4.v2101.ky10.aarch64 #1 SMP Mon May 24 14:45:37 CST 2021 aarch64 aarch64 aarch64 GNU/Linux

[root@ArmServer docker]# cat /proc/version
Linux version 4.19.90-24.4.v2101.ky10.aarch64 (KYLINSOFT@localhost.localdomain) (gcc version 7.3.0 (GCC)) #1 SMP Mon May 24 14:45:37 CST 2021

3. View the operating system architecture

[root@ArmServer docker]# uname -m
aarch64

Two, install docker

1. Download docker offline package

Download address: https://download.docker.com/linux/static/stable/
Select the file directory corresponding to the system architecture: aarch64
(The docker version I am currently using is: docker-20.10.7.tgz)
insert image description here

2. Download docker-compose offline package

2.1. Download address: https://github.com/docker/compose/releases

Select the offline installation package corresponding to the system architecture
(the version I am currently using is: v2.17.2)
insert image description here

2.2. The Github link may not be accessible sometimes, so I built a link myself, and download it by myself if necessary (free of charge)https://download.csdn.net/download/qq_23845083/87800369

3. Prepare the docker.service system configuration file

(Copy the following content and save it as a docker.service file)

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

4. Install docker and docker compose offline packages

4.1. Install docker
# 解压 docker 到当前目录
tar -xvf docker-20.10.7.tgz

# 将 docker 文件移动到 /usr/bin 目录下
cp -p docker/* /usr/bin

# 将 docker-compose 文件复制到 /usr/local/bin/ 目录下,并重命名为 docker-compose
cp docker-compose-linux-aarch64 /usr/local/bin/docker-compose

# 设置 docker-compose 文件权限
chmod +x /usr/local/bin/docker-compose

# 将 docker.service 移到 /etc/systemd/system/ 目录
cp docker.service /etc/systemd/system/

# 设置 docker.service 文件权限
chmod +x /etc/systemd/system/docker.service

# 重新加载配置文件
systemctl daemon-reload

# 启动docker
systemctl start docker

# 设置 docker 开机自启
systemctl enable docker.service

4.2. Verify that the installation is successful

4.2.1 View docker version

[root@ArmServer bin]# docker -v
Docker version 20.10.7, build f0df350

4.2.2 View docker-compose version

[root@ArmServer bin]# docker-compose -v
Docker Compose version v2.17.2

(Note: After the installation is complete, remember to reopen the window, so as not to think that the installation is not successful)

Guess you like

Origin blog.csdn.net/qq_23845083/article/details/130768859