惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
月光博客
月光博客
S
Security Affairs
宝玉的分享
宝玉的分享
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
PCI Perspectives
PCI Perspectives
B
Blog RSS Feed
腾讯CDC
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
T
The Blog of Author Tim Ferriss
H
Help Net Security
Vercel News
Vercel News
W
WeLiveSecurity
U
Unit 42
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
S
Schneier on Security
The Register - Security
The Register - Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
博客园 - Franky
H
Hacker News: Front Page
WordPress大学
WordPress大学
I
Intezer
M
MIT News - Artificial intelligence
博客园 - 叶小钗
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
P
Proofpoint News Feed
V
V2EX
Help Net Security
Help Net Security
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs

卡卡罗特

最后代码 | 卡卡罗特 swagger文档 | 卡卡罗特 react脚手架开发 | 卡卡罗特 python的对象增强 | 卡卡罗特 langchain实现Agent | 卡卡罗特 03.python列表集合元组字典 | 卡卡罗特 python依赖打包 | 卡卡罗特 python的异步 | 卡卡罗特 python的生成器 | 卡卡罗特 eino整合Tools | 卡卡罗特 eino实现Agent | 卡卡罗特 eino整合RAG | 卡卡罗特 docker打包go服务 | 卡卡罗特 01-docker入门 | 卡卡罗特 docker-compose | 卡卡罗特 dockerfile | 卡卡罗特 hertz中间件 | 卡卡罗特 go整合向量数据库ChromaDB | 卡卡罗特 langchainjs | 卡卡罗特 ollama调用各大模型 | 卡卡罗特 spring-ai | 卡卡罗特 自定义一个MCP | 卡卡罗特 context.Context是什么? | 卡卡罗特 01-获取指定网站的所有的链接 | 卡卡罗特 01-Bing每日一图接口 | 卡卡罗特 02-腾讯API高清QQ头像https调用接口 | 卡卡罗特 openCV初体验 | 卡卡罗特 go字符串工具类 | 卡卡罗特 RWMutex读写锁 | 卡卡罗特 SyncMap的使用 | 卡卡罗特 defer的使用 | 卡卡罗特
linux安装docker | 卡卡罗特
2026-05-07 · via 卡卡罗特

linux安装docker ​

在 CentOS 7 系统上安装 Docker,最稳定可靠的方式是通过官方软件源进行。下面是完整的安装和配置步骤。

🗑️ 卸载旧版本(如有) ​

如果系统之前安装过旧版 Docker,请先卸载以避免冲突:

bash

sudo yum remove -y docker \
  docker-client \
  docker-client-latest \
  docker-common \
  docker-latest \
  docker-latest-logrotate \
  docker-logrotate \
  docker-engine

📦 安装 Docker ​

按照以下步骤依次执行:

bash

# 1. 安装必要的依赖工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

# 2. 添加 Docker 官方 yum 源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# 国内用户建议使用阿里云镜像源(更快)
# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 3. 安装 Docker 引擎及相关组件
sudo yum install -y docker-ce docker-ce-cli containerd.io

安装的三大组件说明:

  • docker-ce:Docker 核心引擎(守护进程)
  • docker-ce-cli:Docker 命令行工具
  • containerd.io:容器运行时,负责容器的实际执行

🚀 启动并验证 ​

bash

# 1. 启动 Docker 服务
sudo systemctl start docker

# 2. 设置 Docker 开机自启
sudo systemctl enable docker

# 3. 验证安装是否成功
docker --version

# 4. 运行测试容器
sudo docker run hello-world

如果看到 "Hello from Docker!" 的欢迎信息,说明 Docker 已成功安装并运行。

⚙️ 可选配置(强烈推荐) ​

为了让使用体验更好,建议完成以下配置:

1. 将当前用户加入 docker 组(免 sudo 使用 docker)

bash

sudo usermod -aG docker $USER
# 重新登录或执行以下命令使生效
newgrp docker

2. 配置镜像加速器(国内用户必选)

编辑配置文件:

bash

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": [
    "https://docker.m.daocloud.io",
    "https://dockerproxy.com",
    "https://docker.nju.edu.cn"
  ]
}
EOF

重启 Docker 使配置生效:

bash

sudo systemctl daemon-reload
sudo systemctl restart docker

🧪 验证安装结果 ​

执行以下命令确认一切正常:

bash

# 查看 Docker 版本信息
docker version

# 查看 Docker 运行状态
sudo systemctl status docker

# 列出本地镜像
docker images