延春的技术站 延春的技术站
首页
  • 前端文章

    • JavaScript
  • 页面

    • HTML
    • CSS
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • java
  • python
  • android
  • ois
  • 数据库
  • 中间件安装
  • Docker
  • Linux
  • 技术文档
  • GitHub技巧
  • Nodejs
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 分类
  • 标签
  • 归档

会痛的石头

IT界小学生
首页
  • 前端文章

    • JavaScript
  • 页面

    • HTML
    • CSS
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
  • java
  • python
  • android
  • ois
  • 数据库
  • 中间件安装
  • Docker
  • Linux
  • 技术文档
  • GitHub技巧
  • Nodejs
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 分类
  • 标签
  • 归档
  • 中间件

  • Docker

    • docker安装
    • docker常用命令
    • centos7离线装docker
      • centos7离线安装docker
    • mac系统m1下安装nacos
    • docker安装openvpn
    • docker安装samba
  • Linux

  • 大模型

  • 运维
  • Docker
quyanchun
2023-08-03

centos7离线装docker

# centos7离线安装docker

# 一、下载docker安装文件

下载地址 (opens new window)

# 1、上传到指定目录并解压

cd /home
解压
tar -zxvf docker-24.10.1-ce.tgz
1
2
3

# 2、拷贝docker文件值 /usr/bin

cp docker/* /usr/bin/
1

# 3、进入/etc/systemd/system/目录,并创建docker.service文件

vi /etc/systemd/system/docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
# BindsTo=containerd.service
# After=network-online.target firewalld.service containerd.service
After=network-online.target firewalld.service
Wants=network-online.target
# 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
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=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

[Install]
WantedBy=multi-user.target
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

# 4、重启 docker 服务并自动启动

chmod +x /etc/systemd/system/docker.service #添加文件权限
systemctl daemon-reload #重载unit配置文件
systemctl start docker #启动Docker
systemctl enable docker.service #自动启动

docker version  #验证
1
2
3
4
5
6
上次更新: 2023/08/04, 15:20:45
docker常用命令
mac系统m1下安装nacos

← docker常用命令 mac系统m1下安装nacos→

最近更新
01
Centos7安装caddy 、xui
02-21
02
docker安装samba
09-04
03
docker安装openvpn
07-17
更多文章>
Theme by Vdoing | Copyright © 2021-2025 京ICP备2021033341号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式