栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

麒麟鲲鹏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 - 码农教程

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/880215.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号