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

docker: ubuntu 24.04安装docker

一,docker官网文档

https://docs.docker.com/engine/install/ubuntu/

参考上面官方的安装文档

二,安装docker

更新软件包索引并安装软件包以允许使用 基于 HTTPS 的存储库

# apt update
# apt install ca-certificates curl

添加 Docker 的官方 GPG 密钥

# install -m 0755 -d /etc/apt/keyrings
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
# chmod a+r /etc/apt/keyrings/docker.asc

 

vi /etc/apt/sources.list.d/docker.sources

内容: y

Types: deb
# URIs: https://download.docker.com/linux/ubuntu
URIs: https://mirrors.aliyun.com/docker-ce/linux/ubuntu
Suites: noble
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc

说明:此处的Suites,取/etc/os-release中VERSION_CODENAME的值

说明:使用国内源,阿里云,否则安装时会有连接的报错

# more /etc/os-release
PRETTY_NAME="KDE neon User Edition"
NAME="KDE neon"
VERSION_ID="24.04"
VERSION="User Edition"
VERSION_CODENAME=noble
ID=neon
ID_LIKE="ubuntu debian"
HOME_URL="https://neon.kde.org/"
SUPPORT_URL="https://neon.kde.org/"
BUG_REPORT_URL="https://bugs.kde.org/"
PRIVACY_POLICY_URL="https://kde.org/privacypolicy/"

再执行:

# apt update

安装:

# apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
正在读取软件包列表... 完成

三,测试 效果 :

 

# systemctl status docker.service 
● docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)Active: active (running) since Fri 2025-11-14 23:01:23 CST; 1min 55s ago
TriggeredBy: ● docker.socketDocs: https://docs.docker.comMain PID: 16001 (dockerd)Tasks: 9Memory: 23.3M (peak: 23.7M)CPU: 452msCGroup: /system.slice/docker.service└─16001 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.425632678+08:00" level=info msg="Restoring containers: start."
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.462102249+08:00" level=info msg="Deleting nftables IPv4 rules" error="exit status 1"
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.470876006+08:00" level=info msg="Deleting nftables IPv6 rules" error="exit status 1"
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.885300150+08:00" level=info msg="Loading containers: done."
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.904637182+08:00" level=info msg="Docker daemon" commit=d105562 containerd-snapshotter=true storage-driver=overlayfs version=29.0.0
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.904761511+08:00" level=info msg="Initializing buildkit"
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.917579584+08:00" level=info msg="Completed buildkit initialization"
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.924818204+08:00" level=info msg="Daemon has completed initialization"
11月 14 23:01:23 liuhongdi-pc dockerd[16001]: time="2025-11-14T23:01:23.925112609+08:00" level=info msg="API listen on /run/docker.sock"
11月 14 23:01:23 liuhongdi-pc systemd[1]: Started docker.service - Docker Application Container Engine.

 

http://www.rkmt.cn/news/49890.html

相关文章:

  • 探索“AI元人文”构想:致学者、技术专家与爱好者的一篇导言
  • 实用指南:计算机视觉(opencv)——基于 MediaPipe 人体姿态检测
  • 《团队协作:如何高效进行代码审查》
  • 英国留学中介避坑指南:新通/厚仁领跑,G5录取率93%+的靠谱留学机构清单
  • C# 数据类型与运算符(学习笔记2)
  • 《移动开发:Flutter与React Native的对比》‌
  • 超参数调优:Grid Search 和 Random Search 的实战对比
  • 实用指南:26秋招三分钟快速背诵一个八股-Spring中Bean的生命周期
  • FreeSWITCH使用RNNoise进行实时通话降噪
  • Spring AI Alibaba 项目源码学习(六)-Agent Framework 工作原理与使用
  • 采用 OpenCASCADE 提取布尔运算后平面图形的外轮廓
  • 题解:AtCoder ARC209D A_A_i
  • Kotlin Coroutines
  • 我的标题
  • Java Benchmark使用
  • Go-秘籍-全-
  • Kotlin中的flow、stateflow、shareflow之间的区别和各自的功能 - 教程
  • 非离散网络流——P3347 [ZJOI2015] 醉熏熏的幻想乡
  • Dark Side of the Moon
  • 图片合集
  • 升幂引理(LTE)
  • OpenWrt路由的端口映射问题
  • 解码IPC-管道与信号
  • How-to-extract-text-from-PDF-Image-files-OCR-CarlZeng
  • 升鲜宝供应链管理系统、各端的访问地址及nginx 真实的配置方法
  • 2025.11.14模拟赛
  • uiautomator2元素查看器WEditor的安装和启动
  • MI50 在ubuntu 下 风扇控制实现
  • nvm不能下载安装低版本node解决办法
  • 完整教程:【实时Linux实战系列】实时 Linux 在边缘计算网关中的应用