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

一、Docker本地安装

((这里引用知乎上大佬的说法:https://www.zhihu.com/question/48174633

服务器虚拟化解决的核心问题是资源调配,而容器解决的核心问题是应用开发、测试和部署。

一、参考帖子

Ubuntu 的 |Docker 文档

【docker】ubuntu完全卸载docker及再次安装_ubuntu 卸载docker client卸载-CSDN博客

Docker运行hello-world镜像失败或超时:Unable to find image ‘hello-world:latest‘ locally Trying to pull reposi_unable to find image 'hello-world:latest' locally-CSDN博客


二、实际操作

(1)转到 https://download.docker.com/linux/ubuntu/dists/​。

(2)在列表中选择您的 Ubuntu 版本。

(3)转到 并选择适用的体系结构 (、 、 或 )。pool/stable/amd64armhfarm64s390x​

(4)下载以下文件,用于 Docker 引擎、CLI、containerd、 和 Docker Compose 包:deb​

  • ​containerd.io_<version>_<arch>.deb​
  • ​docker-ce_<version>_<arch>.deb​
  • ​docker-ce-cli_<version>_<arch>.deb​
  • ​docker-buildx-plugin_<version>_<arch>.deb​
  • ​docker-compose-plugin_<version>_<arch>.deb​

(5)安装包。将以下示例中的路径更新为 下载 Docker 包的位置。.deb​

 sudo dpkg -i ./containerd.io_<version>_<arch>.deb \./docker-ce_<version>_<arch>.deb \./docker-ce-cli_<version>_<arch>.deb \./docker-buildx-plugin_<version>_<arch>.deb \./docker-compose-plugin_<version>_<arch>.deb

(6)通过运行映像来验证安装是否成功:hello-world​

 sudo service docker startsudo docker run hello-world
三、运行失败时更换源
1、配置加速地址
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://do.nark.eu.org","https://dc.j8.work","https://docker.m.daocloud.io","https://dockerproxy.com","https://docker.mirrors.ustc.edu.cn","https://docker.nju.edu.cn"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl status docker
2、检查是否配置成功
root@zh-vm:/home/WorkSpace/DOCKER# docker info
Client: Docker Engine - CommunityVersion:    28.3.3Context:    defaultDebug Mode: falsePlugins:buildx: Docker Buildx (Docker Inc.)Version:  v0.26.1Path:     /usr/libexec/docker/cli-plugins/docker-buildxcompose: Docker Compose (Docker Inc.)Version:  v2.6.0Path:     /usr/libexec/docker/cli-plugins/docker-compose。。。 。。。Registry Mirrors:https://do.nark.eu.org/https://dc.j8.work/https://docker.m.daocloud.io/https://dockerproxy.com/https://docker.mirrors.ustc.edu.cn/https://docker.nju.edu.cn/Live Restore Enabled: false
3、运行docker run hello-world
root@zh-vm:/home/WorkSpace/DOCKER# docker run hello-worldHello 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/

验证是否成功拉取hello-world镜像:

root@zh-vm:/home/WorkSpace/DOCKER# docker images
REPOSITORY    TAG       IMAGE ID       CREATED      SIZE
hello-world   latest    1b44b5a3e06a   6 days ago   10.1kB
http://www.dtcms.com/a/332517.html

相关文章:

  • Kafka分区
  • 实现FPS武器的瞄准放大效果(UGUI实现反向遮罩,全屏遮挡,局部镂空效果)
  • 10--C++模板参数与特化详解
  • 【用软件方法实现临界区互斥】
  • Java 正则表达式的使用方法
  • 力扣326:3的幂
  • NLP数据增强方法及实现-A
  • 【R语言】R 语言中 gsub 与正则表达式详解(含 POSIX 与 Perl 风格实例)
  • 深入解析Java代理模式:灵活控制对象访问的核心技术
  • 配置国内加速源后仍然无法拉取镜像
  • 第五天~提取Arxml中CAN波特率属性New_CanCluster--Standard
  • C++面试——内存
  • 【LeetCode 热题 100】45. 跳跃游戏 II
  • 【swift】SwiftUI动画卡顿全解:GeometryReader滥用检测与Canvas绘制替代方案
  • 如何使用亚马逊云科技EC2服务部署语音转写系统
  • 自动驾驶系统“测试”的“要求”与“规范体系”
  • L4 级别自动驾驶 软件架构设计
  • Flask错误处理与会话技术详解
  • 什么是可信空间的全域节点、区域节点、业务节点?
  • python学习 调用硅基流动 对话模型接口 实现 流式输出
  • 剧本杀小程序系统开发:重构推理娱乐生态
  • Spring WebFlux 性能优化实践指南
  • DAY 46 通道注意力(SE注意力)
  • 穿越数学时空:微积分的前世今生与无限未来
  • [论文阅读] 人工智能 | 当Hugging Face遇上GitHub:预训练语言模型的跨平台同步难题与解决方案
  • python30-正则表达式
  • 【模型评估中的BLEU、ROUGE、Bertscore、BERT分别什么意思?】
  • 把 AI 装进“冰箱贴”——基于超低功耗语音合成的小屏电子价签
  • 双面盲文刻印机市场报告:需求增长与技术升级驱动行业发展​
  • 计组-单周期cpu与多周期cpu对比