arm安装docker与docker-copose

一、银河麒麟Arm64安装docker
1、docker 安装包地址:

https://download.docker.com/linux/static/stable
arm安装docker与docker-copose_第1张图片

2、解压,然后将docker目录下文件拷贝到/usr/bin里
tar -xf docker-18.09.3.tgz mv docker/* /usr/bin/

3、准备 docker.service系统配置文件
(复制以下内容保存为 docker.service 文件)

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、安装 docker 和 docker compose 离线包
4.1、安装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、验证安装是否成功
4.2.1查看 docker 版本

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


4.3 docker-compose

arm64位操作系统上可用的docker-compose
docker-compose默认在arm64位的操作系统上无法使用,需要重新编译
添加链接描述

root登录:

 cp docker-compose-Linux-aarch64 /usr/local/bin/docker-compose
 chmod +x /usr/local/bin/docker-compose
 docker-compose --version

非root登录:

sudo cp docker-compose-Linux-aarch64 /usr/local/bin/docker-compose
sudo chown root:root /usr/local/bin/docker-compose
sudo chmod 0755 /usr/local/bin/docker-compose
docker-compose version

你可能感兴趣的:(arm开发,docker,eureka)