Ubuntu 安装 docker

一.添加Docker官方GPG密钥

复制代码
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

如果出现:

The program 'curl' is currently not installed. You can install it by typing:

sudo apt install curl

先安装 curl : sudo apt install curl

再添加GPC密钥,回车看到ok就可以了。

二.添加Docker软件源

复制代码
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

三.安装docker(更新后再安装)

复制代码
sudo apt update && sudo apt install docker-ce

四.添加用户组(避免使用docker命令提示权限问题)

复制代码
sudo usermod -aG docker $USER

PS:需重新登录才能使更改生效。

相关推荐
Anesthesia丶1 小时前
PromoxVE安装笔记
笔记·ubuntu·server·promox
golang学习记13 小时前
Go 项目使用docker compose的正确方式
开发语言·docker·golang
常乐か14 小时前
VMware Workstation Pro 17 搭建 Ubuntu 24.04 完整指南
linux·运维·ubuntu
PGCCC17 小时前
Ubuntu 安装 PostgreSQL 16 完整教程(2026):从仓库配置到远程连接
linux·ubuntu·postgresql
雨声不在18 小时前
私有 Docker Registry 排障实录:两个隐蔽的坑
docker·容器
常乐か18 小时前
在 Ubuntu 24.04 中编译 Qt 5.15.2 项目完全指南
linux·qt·ubuntu
hello_fengfeng18 小时前
fcitx4 和 fcitx5 输入法包冲突
ubuntu
读书读傻了哟18 小时前
解决docker拉取镜像报错failed to resolve reference “docker.io/xxx“...i/o timeout问题
运维·docker·容器
Ai拆代码的曹操20 小时前
DaemonSet OnDelete 策略详解:为何 rollout restart 无效及正确迁移方案
docker·容器·kubernetes
瑞码空间21 小时前
Web应用的多端部署之道:浏览器 · Electron · Docker
前端·docker·electron·浏览器·web