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 安装

相关推荐
java_logo16 分钟前
Docker 部署 WordPress 全流程
运维·docker·容器·word·php·1024程序员节
小小的木头人22 分钟前
Ubuntu 自动挂载移动硬盘
运维
Mr. Sun_1 小时前
Dell Networking SmartFabric OS10 如何设置虚拟链路中继 (VLT)
运维·网络·dell vlt
北城笑笑2 小时前
Server 15 ,VMware ESXi 实战指南:Ubuntu 20.04.6 版本虚拟机静态 IP 配置、分辨率固定及远程访问实践
linux·运维·ubuntu·1024程序员节
汪汪大队u2 小时前
IPv4与IPv6的对比
运维·网络·智能路由器
苹果醋33 小时前
学习札记-Java8系列-1-Java8新特性简介&为什么要学习Java8
java·运维·spring boot·mysql·nginx
武子康3 小时前
Java-159 MongoDB 副本集容器化 10 分钟速查卡|keyfile + –auth + 幂等 init 附 docker-compose
java·数据库·mongodb·docker·性能优化·nosql·1024程序员节
or77iu_N3 小时前
Linux 查找文件
linux·运维·服务器
笑洋仟3 小时前
nvm切换node版本-jenkins上编译
运维·jenkins
zz-zjx3 小时前
MySQL 索引深度指南:原理 · 实践 · 运维(适配 MySQL 8.4 LTS)
运维·数据库·mysql