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

centos9安装docker 配置docker代理

 设置docker库
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
 安装 Docker 包
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
 启动 Docker。
sudo systemctl enable --now docker
 通过运行镜像来验证安装是否成功hello-world: 提示无法下载,连接失败
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
 配置daemon代理文件
 cat /etc/docker/daemon.json
{"registry-mirrors": ["https://docker.m.daocloud.io","https://dockerproxy.com","https://docker.mirrors.ustc.edu.cn","https://docker.nju.edu.cn"]
}
 重启docker验证
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete
Digest: sha256:c41088499908a59aae84b0a49c70e86f4731e588a737f1637e73c8c09d995654
Status: Downloaded newer image for hello-world:latestHello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/[root@localhost ~]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
hello-world   latest    74cc54e27dc4   3 months ago   10.1kB

 

 

 

 

 

http://www.xdnf.cn/news/5739.html

相关文章:

  • TikTok矩阵运营干货:从0到1打造爆款矩阵
  • OpenAI for Countries:全球AI基础设施的“技术基建革命”
  • 免费 OCR 识别 + 批量处理!PDF 工具 提升办公效率
  • 数据挖掘入门-二手车交易价格预测
  • MySQL 8.0 OCP 1Z0-908 51-60题
  • 《驱动开发硬核特训 · 专题篇》:深入理解 I2C 子系统
  • 力扣第156场双周赛
  • c++ std库中的文件操作学习笔记
  • LS-NET-012-TCP的交互过程详解
  • Java GUI 开发之旅:Swing 组件与布局管理的实战探索
  • 3.5 统计初步
  • 前端工程化:从 Webpack 到 Vite
  • 【线段树】P9349 [JOI 2023 Final] Stone Arranging 2|普及+
  • 树莓5安装 PyCharm 进行python脚本开发
  • BFS算法篇——从晨曦到星辰,BFS算法在多源最短路径问题中的诗意航行(下)
  • hivesql是什么数据库?
  • Kafka Go客户端--Sarama
  • 离散制造企业WMS+MES+QMS+条码管理系统高保真原型全解析
  • Readiris PDF:高效文档管理与OCR识别工具
  • 百度智能云千帆携手联想,共创MCP生态宇宙
  • LabVIEW 编程难点
  • 《构建社交应用的安全结界:双框架对接审核API的底层逻辑与实践》
  • 绘制时间对应的数据曲线
  • [经验总结]删除gitlab仓库分支报错:错误:无法推送一些引用到“http:”
  • Kafka 如何保证消息顺序性
  • Open Source Geospatial Content Management System -GeoNode
  • webpack重构优化
  • 3d关键点 可视化
  • WPF的UI元素类型详解
  • 大容量存储的高性能 T-BOX 方案对智能网联汽车的支撑