在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/
热门推荐
徽园:美食与夜游,构建活力旅游新地标
近八成盈利!上市公司成绩单披露,五大亮点速看
视听语言在电影中的作用是什么?
色彩与情绪:如何利用颜色改善心情
杨桃有毒?杨桃禁忌、好处一次看,营养师解答「肾病患者为什么不能吃杨桃」
杨桃怎么吃:五种美味又健康的食用方法
各种罐头到底怎么开?橡皮筋、保鲜膜、砂纸…没想到这些都能用来开罐!
探索有丝分裂的奥秘——模型展示与解读
防范电信诈骗的有效策略与技巧分享
刷刷刷游戏推荐:五款不容错过的刷子游戏
庙堂隶书的代表作—《礼器碑》
期货正套与反套的详解
期权期货定价的方法有哪些?
手机激活后能否退货的探讨
神舟战神z7支持升级win11吗?如何操作?
如何解决便秘能立刻见效 治疗便秘最快的方法
荡起“双桨”,来玉渊潭公园乐享春意诗情
一文读懂热钱包与冷钱包:加密货币存储方式全解析
桃木项链的正确佩戴方法与保养技巧:避免阳光直射、勿接触化学物品
腰椎间盘突出患者如何安全练习瑜伽
90后小时候的回忆,都是经典动漫,网友:全部看过的就真的是老了
豇豆的功效与作用 豆角的家常做法
镇痛“救急”、忍忍就过? 头痛如何正确应对? ——广西医科大一附院规范头痛诊疗
人民币汇率波动分析与展望
《剑与骑士团》新手攻略:装备、神器、格兰武器全介绍
审稿人通常需要多长时间完成论文审稿?
小学二年级编程都学什么
差点让秦国在战国前期消失的"四代乱政"是什么历史事件?
年薪制人员的薪酬核算,年终奖如何计算和发放?
幼猫几个月换牙?猫咪换牙全攻略