在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/
热门推荐
龙生九子解析:文化神话与现实的奇妙结合
力士乐Rexroth液压比例方向阀工作原理详解
刚成立的小公司如何进行资源配置:10人团队的建议
新疆喀纳斯深度游攻略:全方位指南涵盖交通、住宿、美食与必游景点
开源架构安全深度解析:挑战、措施与未来
臂力棒锻炼方法教程
创业评估是什么?如何进行有效的创业评估?
使命召唤:现代战争后坐力稳定系统详解
元气骑士封灵战锤:释放力量的武器
“净沙智探”调研团圆满完成寒假调研
桂林平乐:小众旅游胜地的自然人文之美
如何进行黄金的重量换算?
盘点六本2024年完结的高口碑小说,文笔剧情精彩,强烈推荐一看!
三套实用健身操:从燃脂到糖尿病患者专用,总有一款适合你
如何准备执业律师资格证考试:全面备考指南
彩礼返还起纷争 司法调解树新风—南海法庭精准调解高效治理高价彩礼纠纷
“阳常有余,阴常不足”的理论依据是什么?
解锁记忆的奥秘:高效复习与思维拓展
利尿药与心血管有什么样的关系?
18k金跟黄金有哪些区别
优化时间管理:探索高效率人生的秘诀与策略
高中生科研:颜色心理学在市场营销中的应用
职业化与全民化共融 LOL手游电竞做了一些新尝试
石雕如来佛的摆放位置对家居风水有什么影响?
如何记住日语汉字发音:实用技巧与方法
发菜的功效与作用、禁忌和食用方法
福楼拜《包法利夫人》:超越人生的凄迷和狂妄
兽用氯前列醇钠什么时候用?能解决什么问题
创业团队资源如何获得
英国CS为什么是理学硕士