Linux ubuntu 20.4.6安装docker

这边需要在vm中使用docker,记录下

1.更新系统包列表

确保您的系统包列表是最新的

bash 复制代码
sudo apt update

2.安装依赖工具

bash 复制代码
sudo apt install apt-transport-https ca-certificates curl software-properties-common

3.添加Docker GPG密钥

bash 复制代码
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

4.设置Docker存储库

bash 复制代码
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

5.再次更新系统包列表

bash 复制代码
sudo apt update

6.安装Docker Engine

bash 复制代码
sudo apt install docker-ce docker-ce-cli containerd.io

7.验证安装

bash 复制代码
sudo docker --version

如果看到版本出现,就代表安装成功了

相关推荐
方便面不加香菜3 小时前
Docker Volume -- 对照总结及综合实战案例操作演示
运维·docker·容器
dingdingfish5 小时前
TLPI 第52章 读书笔记:POSIX Message Queues
linux·mq·ipc·posix·message·tlpi
wacsii6 小时前
【Linux进程(五)】进程控制全解析:从创建、终止、等待到程序替换
linux·服务器
七夜zippoe6 小时前
Nexent Linux 部署:用 deploy.sh
linux·服务器·docker·部署·ai智能体·nexent
去码头整点薯条986 小时前
NFS服务器
linux·运维·服务器
蜗牛一步步往上爬7 小时前
第一章 初识Linux shell
linux·运维·服务器
拂拉氏7 小时前
【知识讲解】 Linux线程中锁的认识
linux·互斥锁
无足鸟ICT8 小时前
【RHCA+】系统调优配置文件
linux·服务器
时间的拾荒人9 小时前
Shell 脚本核心语法详解(下篇):流程控制、函数、重定向与文件包含
linux·运维·服务器·bash·脚本编程