新闻详情

新闻详情

首页 / 资讯中心 / 详情

Dokcer(五) Dcoker的使用

发布时间:2026/11/16 15:59:59来源:尧图网络
Dokcer(五) Dcoker的使用
Docker安装Server版本以 OS版本Ubuntu 22.04 为例安装:cpu为x86_64:先卸载旧版本, 如果是新机器(云服务器or虚拟机)一般默认是没有的, 可以通过输入docker version查看, 如果没有这个命令, 就不需要卸载:如果需要卸载, 执行:# 1卸载旧版本sudoapt-getremovedockerdocker-engine docker.io containerd runc Reading package lists... Done Building dependency tree Reading state information... Done E: Unable tolocatepackage docker-engine# 2卸载历史版本# 卸载软件sudoapt-getpurge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras-y# 删除用户数据, 比如旧的容器,镜像等sudorm-rf/var/lib/dockersudorm-rf/var/lib/containerd配置 docker 下载源# 1. curl 命令安装sudoaptinstallcurl-y# 2. 添加 Docker 官方 GPG key:# 2.1 创建 gpg key 目录sudomkdir-m0755-p/etc/apt/keyrings# 2.2 下载 gpg keycurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudogpg--dearmor--yes-o/etc/apt/keyrings/docker.gpg添加 Docker 官方软件源# 3.1 添加 Docker 官方软件源echo\deb [arch$(dpkg --print-architecture)signed-by/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release-cs)stable|sudotee/etc/apt/sources.list.d/docker.list/dev/null# 3.2 更新aptsudoapt-getupdate安装# 4. 安装sudoapt-getinstalldocker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin-y自动启动配置#配置加载sudosystemctl daemon-reload#启动服务sudosystemctl startdocker#开启启动sudosystemctlenabledocker查看服务状态sudo systemctl status docker, 可以看到docker服务正常启动6. 检查安装结果查看版本# docker版本, 可以看到客户端和服务端的版本以及组件dockerversion Client: Docker Engine - Community Version:29.8.1 API version:1.56Go version: go1.26.8 Git commit: 4a63305 Built: Tue Sep1516:25:262026OS/Arch: linux/amd64 Context: default....# 更详细查看 docker 信息dockerinfo 比如: Containers:0Running:0Paused:0Stopped:0Images:0Server Version:29.8.1 Storage Driver: overlayfs Docker Root Dir: /var/lib/docker配置Docker镜像源, 因为官网的docker hub 直连一般访问不了, 所以可以配置一些国内的镜像源,vim /etc/docker/daemon.json:{registry-mirrors:[https://镜像加速地址]}然后通过docker info, 可以看到server 配置的镜像源地址:Registry Mirrors: https://xx https://xxx运行一个helloworld试一下:sudodockerrun hello-world Unable tofindimagehello-world:latestlocally latest: Pulling from library/hello-world 4f55086f7dd0: Pull complete d5e71e642bf5: Download complete Digest: sha256:5e23090353324d887c48ad5e5c56d294eab81588df9605b07d1afe895f9cc8f8 Status: Downloaded newer imageforhello-world:latest Hello 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 thehello-worldimage from the Docker Hub.(amd64)3. The Docker daemon created a new container from that imagewhichruns the executable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client,whichsent it to your terminal. To try somethingmoreambitious, you can run an Ubuntu container with: $dockerrun-itubuntubashShare images, automate workflows, andmorewith afreeDocker ID: https://hub.docker.com/ Formoreexamples and ideas, visit: https://docs.docker.com/get-started/Docker 目录修改Docker 默认的安装目录为/var/lib/docker,这里面会存放很多很多镜像所以我们在安装的时候需要考虑这个目录的空间有三种解决方案。1将/var/lib/docker 挂载到一个大的磁盘这种一般我们能控制挂载目录像腾讯云这种云厂商在安装 K8s 的节点的时候提供了挂载选项可以直接挂载这个目录过去2安装之前挂载一个大的磁盘然后创建一个软链接到/var/lib/docker这样就自动安装到我们空间比较大的磁盘了3安装了 docker然后发现忘了配置这个目录我们需要修改 docker 的配置文件# 假定我们磁盘的大的目录为 /datamkdir-p/data/var/lib/docker# 编辑配置文件vi/etc/docker/daemon.json添加data-root: “/data/var/lib/docker”:然后, 重新加载配置并重启docker:systemctl daemon-reload,systemctl restart docker.执行docker info后, 可以查看目录修改完毕:GUI 版本安装以Windows11为例:暂存
网站建设高端定制企业官网
RELATED

相关资讯

更多精彩内容,欢迎继续阅读

较早相关资讯

最新相关资讯

【外设】之大彩串口显示屏 2026/11/15 4:54:16

【外设】之大彩串口显示屏

大彩串口屏初步使用 1 .官网下载 STM32 屏幕 GUI 设计资料 http://www.gz-dc.com/category/typeid/4112 找到 STM32 Keil 工程,移植相关代码因项目而异进行移植,由于项目简单,本人只对用到的指令接口进行修改。 比如:注意事项&…

阅读更多 →
无法下载Windows系统iso文件 2026/11/15 2:04:12

无法下载Windows系统iso文件

当我遇到这个问题的时候,我打开了一个网站: 登录 然后我打算下载的时候: 突然那个官方的连接就可以下载了:

阅读更多 →
【清华代码熊】DeepSeek V4.1 Flash 后训练详解 2026/11/14 10:11:15

【清华代码熊】DeepSeek V4.1 Flash 后训练详解

📌 上期解析了 DeepSeek V4.1 Flash 模型架构改进,本期解析 DeepSeek V4.1 Flash 预训练/后训练技术: 🌟 预训练:45T 文本 多模态混合语料、直接训练 sparse attention(取消 DeepSeek V4 的 dense 冷启动&…

阅读更多 →
Shuffle-R1: Efficient RL framework for Multimodal Large Language Models via Data-centric Dynamic ... 2026/11/16 6:47:19

Shuffle-R1: Efficient RL framework for Multimodal Large Language Models via Data-centric Dynamic ...

文章主要内容和创新点 主要内容 本文聚焦于多模态大语言模型(MLLM)强化学习(RL)训练中的效率问题,提出了一个名为Shuffle-R1的框架。研究发现,当前RL训练存在两个关键缺陷: 优势值坍缩(Advantage Collapsing):批次中大多数优势值集中在零附近,导致有效梯度信号被淹…

阅读更多 →
PRvL: Quantifying the Capabilities and Risks of Large Language Models for PII Redaction 2026/11/14 16:35:50

PRvL: Quantifying the Capabilities and Risks of Large Language Models for PII Redaction

一、文章主要内容总结 本文聚焦于利用大型语言模型(LLMs)实现个人身份信息(PII)脱敏的研究,旨在解决传统脱敏方法(如基于规则的系统、领域特定命名实体识别(NER)模型)泛化能力差、跨格式/跨语境适应性弱的问题。 研究通过全面评估多种LLM架构(包括密集型LLM(D-LLM…

阅读更多 →
LLaVA-RE: Binary Image-Text Relevancy Evaluation with Multimodal Large Language Model 2026/11/15 4:06:36

LLaVA-RE: Binary Image-Text Relevancy Evaluation with Multimodal Large Language Model

文章主要内容和创新点 主要内容 本文聚焦于二进制图像-文本相关性评估任务(判断图像与文本“相关”或“不相关”),针对该任务中文本格式多样、相关性定义随场景变化等挑战,提出了基于多模态大语言模型(MLLM)的解决方案LLaVA-RE。 模型设计:LLaVA-RE基于LLaVA 1.5架构,…

阅读更多 →

今日资讯

本周资讯

本月资讯

看完文章仍有疑问?

联系尧图顾问,获取一对一建站咨询

立即免费咨询 📞 400-888-8888
📞 ✉