麒麟高级服务器操作系统V10安装docker

背景

服务采用docker启动,适配国产化麒麟V10系统,需要安装docker

引用自己博客:麒麟高级服务器操作系统V10安装docker - 穆琪的博客 (muhongqiao.top)

软件包

使用二进制的安装方式进行安装,docker版本为19.03.15

docker下载地址:Index of linux/static/stable/x86_64/

选择对应版本的tgz包即可。

安装步骤

解压安装包

tar -zxf docker-19.03.15.tgz’
\cp docker/* /usr/bin/

创建配置文件

vi /etc/systemd/system/containerd.service

内容为:

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target
[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/containerd
Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=1048576
TasksMax=infinity
OOMScoreAdjust=-999
[Install]
WantedBy=multi-user.target
vi /etc/systemd/system/docker.service

内容为:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service time-set.target
Wants=network-online.target containerd.service
Requires=docker.socket
[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 -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always
# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3
# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s
# 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
# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=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
OOMScoreAdjust=-500
[Install]
WantedBy=multi-user.target
vi /etc/systemd/system/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

修改权限

chmod 755 /etc/systemd/system/docker.service
chmod 755 /etc/systemd/system/docker.socket
chmod 755 /etc/systemd/system/containerd.service

启动服务

systemctl enable --now containerd.service
groupadd docker
systemctl enable --now docker.socket  && systemctl enable --now docker.service
systemctl start docker

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在麒麟V10安装Docker,您可以按照以下步骤进行操作: 1. 打开终端或命令行界面。 2. 首先,更新系统的软件包列表。使用以下命令: ``` sudo apt update ``` 3. 安装Docker的依赖软件包。使用以下命令: ``` sudo apt install apt-transport-https ca-certificates curl software-properties-common ``` 4. 添加Docker的官方GPG密钥。使用以下命令: ``` curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ``` 5. 添加Docker的软件源。使用以下命令: ``` echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` 6. 更新软件包列表以使更改生效。使用以下命令: ``` sudo apt update ``` 7. 最后,安装Docker。使用以下命令: ``` sudo apt install docker-ce docker-ce-cli containerd.io ``` 8. 安装完成后,您可以通过运行以下命令验证Docker是否正确安装: ``` sudo docker run hello-world ``` 如果一切正常,您将看到一个简单的Hello World消息,表示Docker已经成功安装。 请注意,安装Docker可能需要一些时间,并且具体的步骤可能会因为操作系统版本的不同而有所变化。以上步骤适用于麒麟V10,但在安装之前,请确保您已经阅读了Docker的官方文档并了解了适用于您系统的最新安装指南。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值