麒麟鲲鹏arm系统下离线文件包安装docker,并且配置自动启动服务

本文介绍了在麒麟鲲鹏arm64位系统上,由于yum安装Docker可能出现问题,因此提供了离线安装Docker的详细过程。包括下载Docker二进制文件,将其移动到/usr/bin目录,创建并配置docker.service和docker.socket文件,以及修改相关配置文件,最终通过systemctl启动Docker服务,使得Docker在该环境下正常运行。
摘要由CSDN通过智能技术生成

麒麟鲲鹏arm 64位主机,直接yum install docker可能找不到,需要更换镜像源等,更换之后可能还会出现比如下报错:

nothing provides container-selinux >= 2:2.74 needed by docker-ce-3:20.10.15-3.el7.aarch64

那位为了避免环境设置,可以用离线形式来安装docker服务。

  • 下载docker,解压,并且移动解压出来的二进制文件到 /usr/bin 目录中,并且测试启动
wget -r https://download.docker.com/linux/static/stable/aarch64/docker-17.09.0-ce.tgz

tar -zxvf docker-20.10.9.tgz

mv docker/* /usr/bin/

dockerd
  • 进入到系统服务目录,创建docker服务文件

        cd /usr/lib/systemd/system

        touch 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
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash

ExecStart=/usr/bin/dockerd $OPTIONS \
                           $DOCKER_STORAGE_OPTIONS \
                           $DOCKER_NETWORK_OPTIONS \
                           $INSECURE_REGISTRY
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
# 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

[Install]
WantedBy=multi-user.target
EOF
#============================================
cat > /etc/sysconfig/docker <<'EOF'
# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--live-restore'

DOCKER_CERT_PATH=/etc/docker

# If you have a registry secured with https but do not have proper certs
# distributed, you can tell docker to not look for full authorization by
# adding the registry to the INSECURE_REGISTRY line and uncommenting it.
# INSECURE_REGISTRY='--insecure-registry'

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overridden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp
EOF
#========================================================

cat > /etc/sysconfig/docker-storage <<'EOF'
# This file may be automatically generated by an installation program.

# By default, Docker uses a loopback-mounted sparse file in
# /var/lib/docker.  The loopback makes it slower, and there are some
# restrictive defaults, such as 100GB max storage.

# If your installation did not set a custom storage for Docker, you
# may do it below.

# Example: Use a custom pair of raw logical volumes (one for metadata,
# one for data).
# DOCKER_STORAGE_OPTIONS = --storage-opt dm.metadatadev=/dev/mylogvol/my-docker-metadata --storage-opt dm.datadev=/dev/mylogvol/my-docker-data

DOCKER_STORAGE_OPTIONS=
EOF
#======================================================

cat > /etc/sysconfig/docker-network <<'EOF'
# /etc/sysconfig/docker-network
DOCKER_NETWORK_OPTIONS=
EOF
  • 在当下目录中再创建一个文件

        touch docker.socket,并且将以下内容粘贴到该文件中,保存

[Unit]
Description=Docker Socket for the API

[Socket]
# If /var/run is not implemented as a symlink to /run, you may need to
# specify ListenStream=/var/run/docker.sock instead.
ListenStream=/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target
EOF

随后即可执行启动docker服务了!

systemctl start docker

成功启动后docker ps等命令在当下的麒麟鲲鹏arm系统中国你就可以正常使用了!

参考文章:华为鲲鹏+麒麟系统安装docker - 码农教程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IOTOS

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值