在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/
热门推荐
脑动脉瘤手术哪种方法最安全彻底
遇到火灾时,这扇“门”有多重要?
如何规范填写租赁合同以避免纠纷?这些合同条款有哪些法律细节?
劳动合同能随便更改吗?一文详解劳动合同变更、试用期和未签合同赔偿问题
Excel中先乘后加的计算方法详解
高技术的颗粒捕捉器,是如何工作的呢?了解多少?
12 种马铃薯及其烹饪方法
战锤40K | 阵营聚焦:钛帝国
中医推拿按摩师报考资讯:中医推拿按摩师职业前景分析
武汉澳门两地高校长期合作,在柴达木盆地探究火星秘密
批判性思维与文化素养
美国大学宿舍的设施、类型及住宿体验是怎样的呢
如何设置防火墙以允许特定应用程序访问网络?
植保无人机要考什么证 植保无人机驾驶证怎么考取
手把手教你2025年在手机上注册谷歌账号:11个步骤详解与关键注意事项
cos委托:跨越次元的真实链接,承载心意的双向奔赴
山东高考复读生如何模拟实战,提升应试能力?
金融百科|如何投保一份合适的董责险?
在美国如何寻找移民律师进行咨询
命理之缺:从命理上看看你缺什么
一文了解汽车万向传动装置
50种最常吃的家常菜菜名做法
肿瘤患者的暖心食谱:10道适合冬季食用的家常菜
盲派八字与传统八字的区别和联系
单位工作证明开具有限性吗?如何确保其真实性和有效性?
深耕作业管理 赋能学生成长
如何根据足弓类型挑选最适合你的跑鞋?
中南大学2024年考研复试分数线公布
在逻辑之外,探索随机:AI 时代的数学新思维
如何向腾讯公司进行投诉?多种渠道和步骤详解