在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/
热门推荐
LOL2025赛季厄塔汗BUFF属性效果介绍
社保基金投运保持稳健
逾期未退的包装物押金收入需要交增值税吗?以什么税率缴税
灭菌监测必备知识之生物指示剂的分类及应用
几块钱的矿泉水,喝了真能补充矿物质吗?一文揭晓答案
名字的秘密:河大明伦校区的大礼堂被烧毁了,“明伦”会幸免吗?
希腊地图 - 希腊地图高清版 - 希腊地图中文版
横突骨折怎样恢复得快
复旦大学文学院中文系中国古典文献学的研究生培养方案
咽喉疾病挂什么科
如何配置RAID 5硬盘
股票市场交易时机把握:如何把握交易时机
《哪吒 2》热映:敖丙他爹凭啥火出圈?
怎么查驾照分数
我国商业健康险行业保费收入破九千亿 医保+商保数据互通或提高赔付率
7点起床的最佳入睡时间是几点?
红麴是什么?功效与风险全解析
证券账户各类交易权限开通要求大全,值得收藏!创业板/科创板/北交所/港股通
獾油的作用及功效
DC暗黑双雄崛起:贝恩与丧钟联手打造反派电影新纪元
嗓子咳嗽都是黄痰?原因分析与应对指南
文件或目录损坏且无法读取怎么办?4个方法帮您恢复文件
《决胜巅峰》新手上分英雄推荐:射手篇
如何找到适合自己的科研导师?
智能充电器真的伤电池吗?
图像修复技术全面解析:从理论到实践的关键技术详解
如何通过成交量分析股票市场的热度
孩子打嗝怎么办?五种实用止嗝方法
总部经济与CBD发展:全球经验与中国实践
课题申报书中的“国内外研究进展”部分怎么写?