Deepin 23.10安装Docker

个人博客地址:Deepin 23.10安装Docker | 一张假钞的真实世界

Deepin 是基于 Debian 的国产 Linux 发行版,安装 Docker Desktop 可能会遇到兼容性问题,因为 Docker Desktop 官方主要支持 Ubuntu/Debian/Red Hat/Fedora/Arch 等主流发行版,所以选择安装 Docker Engine。

  • 卸载旧版本(如有)

    sudo apt remove docker.io docker-doc docker-compose podman-docker containerd runc

  • 安装依赖

    sudo apt update
    sudo apt install -y ca-certificates curl gnupg lsb-release

  • 添加 Docker 官方 GPG 密钥

    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

  • 添加 Docker 源

由于 Deepin 基于 Debian,可以使用 Debian 的 Docker 源(需匹配 Deepin 版本对应的 Debian 版本)。

查看Deepin对应的Debian版本:

复制代码
$ cat /etc/debian_version
bookworm/sid

执行以下命令添加 Docker 源:

复制代码
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • 安装 Docker Engine

    sudo apt update
    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

  • 启动 Docker

    sudo systemctl enable --now docker

  • 允许普通用户运行 Docker

    sudo usermod -aG docker $USER
    newgrp docker # 重新加载用户组

可能需要重启电脑。

  • 测试 Docker

    sudo docker run hello-world

需先配置国内镜像源。现在可用的镜像源越来越少了,推荐一篇良心博文:https://zhuanlan.zhihu.com/p/24461370776。

安装成功的验证结果信息如下:

复制代码
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete 
Digest: sha256:dd01f97f252193ae3210da231b1dca0cffab4aadb3566692d6730bf93f123a48
Status: Downloaded newer image for hello-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 the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share 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/

Deepin 20.9 社区版安装 Docker 见文章:Deepin 20.9 社区版安装 Docker。

DockerHub 镜像源配置见文章:Linux 配置 DockerHub 镜像源配置。

Docker Compose 安装见文章:Linux 系统 Docker Compose 安装。

相关推荐
wespaul3 分钟前
VeapAI 自然语言操作实战|第 08 篇:治理层——审计、指标、评估与权限
运维·网络·数据库
Sayai5 分钟前
Kafka 2.8→3.9.1 跨大版本升级实战:ZooKeeper 同步升级、数据目录迁移与回滚预案全流程
大数据·运维·分布式·zookeeper·kafka
chenxy027 分钟前
国产加速卡-应知应会
linux·运维·服务器
HackTwoHub8 分钟前
免 Root 安卓渗透工具 Stryker|把 Kali 装进手机!随身无线渗透工作站,内置 Nmap/Nuclei/Metasploit 全套武器库
android·linux·运维·人工智能·web安全·macos·智能手机
data analyse 45626 分钟前
页面卸载时埋点上报总丢失?sendBeacon 上报与补偿方案
大数据·运维·服务器·前端·数据库·人工智能·数据分析
倔强的石头1061 小时前
【Linux指南】进程通信系列(二):匿名管道 —— pipe 的本质、fork 继承与四种读写规则
java·linux·运维
硅基手札1 小时前
【Linux 内核专栏 18】进程间通信 IPC(下)— Socket·Netlink·fd 三件套·futex·线程同步
linux·运维·驱动开发·单片机·嵌入式硬件·mcu·架构
吴佳浩 Alben1 小时前
一文看懂大模型推理为什么需要多卡:从 TP、DP 到 Runtime 的完整演进
运维·服务器·人工智能·深度学习·语言模型·vllm·sglang
kaixin_啊啊1 小时前
飞牛部署Mtab完整实战:Docker安装、MySQL建库与固定地址访问
mysql·docker·容器
djjjx.1 小时前
Linux进程篇(二):深入浅出 [进程概念与进程父子关系]:从底层原理到实战应用
linux·运维·服务器