在Debian 12系统上安装Docker
创作时间:
作者:
@小白创作中心
在Debian 12系统上安装Docker
引用
CSDN
1.
https://m.blog.csdn.net/weixin_43846408/article/details/137608975
Docker 是一个开源的容器引擎,可以让开发者打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。本文将详细介绍如何在 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/
热门推荐
链式代理到底是什么?带你了解链式代理的原理机制
2025 年,非常值得做的六大外贸蓝海市场分析
详解密宗胎藏界与金刚界
音乐有三六九等吗?什么才算是“好歌”?
黄痰轻、白痰重、吐了黑痰要谨慎,3种痰各说明什么?
什么是法无定法?
国家公务员好找工作吗?知乎讨论揭秘
操作系统实验:网络通信协议栈的构建与测试秘籍
银行自助设备维护外包服务:质量控制与成本管理的关键考量
朝鲜战争,美军战败的原因之一,在于其军事思想和理论落后于中国
电脑怎么设置锁屏密码?这3个方法你知道吗
孩子缺爱成长中的心理影响与应对策略
ISFJ人格类型:忠诚、细心与责任感的完美结合
立春绘“春牛”
软件开发领域如何获取最新消息
主板、创业板、科创板,股市里的“三兄弟”,你了解多少?
《红楼梦》才是你的"人间修炼指南"
科学家通过嫦娥五号月壤研究提出大量生产水的方法
填补月背研究历史空白!嫦娥六号挖回的月背土壤成分揭秘
晨型瑜伽人的生物钟改造计划:从熬夜到5点自然醒
世界十大酿酒葡萄品种概览
哪个好:财务部定量考核还是定性考核?
了解新加坡的生活成本:旅行者和外籍人士必备小贴士
新加坡各类移民的特殊要求有哪些
笔记本电脑触控板失灵怎么办?多种实用解决方案帮你轻松应对
紧凑型聚变反应堆电子温度破纪录,远超1000万摄氏度
梅毒传播哥伦布“功不可没”
辐射4星核选择大揭秘:你的决策将如何改变游戏命运?
我国承建老挝水电站,耗资54亿元,3台机组1年发电8.8亿千瓦时
Excel表格中查找产品型号的四种方法