当前位置: 首页 > article >正文

docker-ce部署

 简单安装方式

 yum list |grep docker


在rocky虚拟机中配置docker

安装必要的一些系统工具

 yum install -y yum-utils
 yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

下载社区版的docker

yum install docker-ce

在openeuler安装docker-ce 

dnf -y install dnf-plugins-core
 dnf config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

添加软件源信息 

dnf config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

未识别到8的版本更改一下配置文件 

将$releasever改成8

按下Esc
:% s/$releasever/8

配置docker加速器 

 cd /etc/docker/
vim daemon.json
{
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.nju.edu.cn"
    ]
}

测试拉取一个镜像


二进制配置docker 

在另外一台openeuler虚拟主机中配置

准备docker-ce二进制包

https://download.docker.com/linux/static/stable/x86_64/docker-28.0.1.tgz

配置相关服务配置文件

有三个配置文件:docker.service 、docker.socket、 containerd.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

docker.socket配置文件: 

 vim /etc/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API
PartOf=docker.service
[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
[Install]
WantedBy=sockets.target

 containerd.service配置文件:

vim /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
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=infinity
# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999
[Install]
WantedBy=multi-user.target

 创建用户组

chown -R root.root docker/*
复制二进制文件到/usr/bin/目录

 cp docker/* /usr/bin/

配置加速器 

vim /etc/docker/daemon.json
{
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.nju.edu.cn"
    ]
}

 启动

 

拉取镜像


http://www.kler.cn/a/576509.html

相关文章:

  • SAP DOI EXCEL宏的使用
  • VUE_自定义指令,全局指令注册
  • 网络运维学习笔记(DeepSeek优化版) 014网工初级(HCIA-Datacom与CCNA-EI)NAT网络地址转换
  • 鸿蒙生态日日新,鸿蒙原生版支付宝下载量突破230万
  • 数学建模笔记——层次分析法(AHP)
  • 【Leetcode 每日一题 - 补卡】2588. 统计美丽子数组数目
  • 职坐标机器学习编程实战:调试优化与自动化测试精要
  • easyconnect下服务器联网
  • 迁移学习简述
  • Android14 OTA升级
  • 三、Prometheus监控流程
  • 下载Hugging Face模型的几种方式
  • 云端秘境:EC2的奇幻之旅
  • PROFINET转PROFIBUS从案例剖析网关模块的协议转换功能
  • vue-cli + echarts 组件封装 (Vue2版)
  • Centos 7的内存占用过大问题排查---docker相关
  • 前端知识一
  • 在 Linux 下,服务器如何知道某个 TCP 连接来了消息? 这就涉及 IO 事件通知机制!
  • 使用css变量实现更改字体大小功能(vue3为例)
  • nodejs关于后端服务开发的探究