在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/
热门推荐
如何有效消除眼袋?多种实用方法帮你重获明亮双眸
《周易》基础:十二消息卦详解(建议收藏)
秦兵马俑:历史意义与价值深度解析
MATLAB将数据输出到Excel的四种方法详解
苏格拉底《申辩》的历史背景
人工智能技术概念的基本定义是什么?
人才梯队建设与接班人培养计划
为啥有些人一上车就把“自动启停”永久关闭?内行人说出了大实话,你怎么看?
于右任书法真假对比分析
电动车电池充电,几个小时才能充满?亮绿灯后要多久才能拔电源?
A股融资余额5连升!一批小微盘股被融资客盯上
改良版蓝色梯子指标:源码详解与实战应用
炒外汇用EA交易,如何有效控制EA亏损及爆仓
残疾人办理营业执照优惠政策全解析
打工人开始研究“飞机餐隐藏款”了?
《小巷人家》为什么这么火?
服了!为何说《小巷人家》是一部写尽人性与时代的灵魂之书?
石棉对皮肤的危害有哪些
无钥匙进入系统使用指南:自动上锁问题及预防措施
日本亚文化中的“天然呆”现象:深入分析与探讨
婆婆拒绝带宝宝,家庭如何应对?
软件开发如何选择服务器
如何正确储存蜂蜜?蜂蜜不易变质的秘密揭秘!
侵权行为的构成要素及应对指南
调岗强迫离职怎么处理
烟台红富士苹果什么时候成熟
国药向“新”而行 | 创新驱动引领高质量发展
制作蜡烛的工艺流程
消灭蚂蚁最高效最彻底的方法,省时省力又安心!
一辈子很长,找个有趣的人在一起