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

在Debian 12系统上安装Docker

debian12 安装 docker

Docker 在 Debian 12 上的安装

  • 安装
  • 验证
  • 测试
  • 更多信息

引言
在现代的开发环境中,容器技术发挥着至关重要的作用。Docker 提供了快速、可靠和易于使用的容器化解决方案,使开发人员和 DevOps 专业人士能够以轻松的方式将应用程序从一个环境部署到另一个环境。 Docker 的安装过程在 Debian 12 系统上非常简单,只需几条命令即可完成。在接下来的部分,我将详细介绍 Docker 的安装步骤和基本功能。

安装

安装 Docker 需要以下条件:

  • 已经安装的 Debian 12 系统 (VM 或硬件服务器)
  • root 权限

可以使用以下命令安装 Docker:

sudo su &&
apt update &&
apt install ca-certificates curl gnupg apt-transport-https gpg

下载 GPG 密钥并将其存储在系统中:

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" |tee /etc/apt/sources.list.d/docker.list > /dev/null 
apt update

安装 Docker 包:

apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose

验证

可以使用以下命令检查 Docker 是否安装成功并是否在系统启动时自动启动:

systemctl is-active docker

测试

也可以通过启动 hello-world Docker镜像来测试安装是否成功:

docker run hello-world

如果一切正常,将看到类似以下输出:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
478afc919002: Pull complete
Digest: sha256:03b30c6a3c320ff172b52bd68eddffde6ded08ce47e650fe52de861c5e9df46d
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.
    (arm64v8)
 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/

更多信息

有关 Docker 的更多信息,请参阅以下页面:

  • Docker 官方文档:https://docs.docker.com/get-started/
  • Docker Hub:https://hub.docker.com/

相关文章:

  • 专业级股票交易系统 股票金融平台 带新股申购 通信达源码
  • three.js尝试渲染gbl模型成功!(三)
  • unable to find a medium containing a live file system解决办法!
  • 深入浅出 -- 系统架构之负载均衡Nginx的性能优化
  • 深入浅出 -- 系统架构之负载均衡Nginx反向代理
  • Go语言map、slice、channel底层实现(go面试)
  • Harmony鸿蒙南向驱动开发-DAC
  • 损失函数:BCE Loss(二元交叉熵损失函数)、Dice Loss(Dice相似系数损失函数)
  • SSM实战项目——哈哈音乐(二)后台模块开发
  • Node.js环境调用百度智能云(百度云)api鉴权认证三步走
  • 北航计算机软件技术基础课程作业笔记【3】
  • Java项目:基于Springboot+vue实现的中国陕西民俗前后台管理系统设计与实现(源码+数据库+毕业论文)
  • ICP配准算法
  • 计算机专业,不擅长打代码,考研该怎么选择?
  • 数据结构—红黑树
  • ThreadLocal加切面实现线程级别的方法缓存
  • QT 线程的使用
  • PDF锐化
  • 【运输层】传输控制协议 TCP
  • easyExcel - 动态复杂表头的编写
  • https://app.hackthebox.com/machines/Inject
  • Spring —— Spring简单的读取和存储对象 Ⅱ
  • 渗透测试之冰蝎实战
  • Mybatis、TKMybatis对比
  • Microsoft Office 2019(2022年10月批量许可版)图文教程
  • 《谷粒商城基础篇》分布式基础环境搭建
  • 哈希表题目:砖墙
  • Vue 3.0 选项 生命周期钩子
  • 【车载嵌入式开发】AutoSar架构入门介绍篇
  • 【计算机视觉 | 目标检测】DETR风格的目标检测框架解读