在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/
热门推荐
长途出行超千公里,纯电动汽车能否胜任?使用攻略来了!
北京7处世界文化遗产,你真的了解吗?
张爽:以高水平对外开放绘就北京高质量发展新图景
川西大环线秋季自驾游,你准备好行囊了吗?
川西大环线自驾游,稻城亚丁、色达、理塘全攻略
冬日川西大环线:稻城亚丁雪景打卡
川西大环线打卡亚丁,人间仙境不容错过
苜蓿草对马有好处吗?
盐酸特比萘芬凝胶PK达克宁,谁才是真菌克星?
达克宁护肤新潮流:科学抗真菌
条码识别技术:从原理到智能化创新
条形码技术:揭秘背后的神奇世界
春节假期去哪儿?泡温泉、看古建,都在长三角
三书六礼:中国古代婚礼的神秘面纱
基金亏损,理财师如何管理心理压力?
理财师的自我管理秘籍:AFP&CFP双证加持
高净值客户理财师:财富管理领域的专业“管家”
理财师必备技能全解析:从金融知识到实战经验
冬季养生必备:猪皮冻变种做法大揭秘
分散投资:构建低风险投资组合的策略与技巧
投资计划与目标:如何设定清晰的投资计划和目标
高血压患者可以适量食用车厘子
左侧肋骨下方疼是什么原因引起的
《蛟龙行动》春节档引爆,张涵予揭秘潜艇机密
基金定投:如何摊平成本,降低风险?
小泉一代带你快速通关《弹丸论破:绝对绝望少女》
熬夜容易长痘痘吗 如何养成无痘肌肤
喜羊羊与灰太狼:皓月VS明日公主谁更圈粉?
喜羊羊新作揭秘:明日皓月姐妹情
春运期间火车票大优惠:桂林到广州53元,1元火车票再现