How to install Docker CE for Ubuntu 24.04 LTS

step 1

bash 复制代码
sudo apt install ca-certificates curl gnupg lsb-release

step 2

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

step 3

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

或者

bash 复制代码
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.bfsu.edu.cn/docker-ce/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

step 4

bash 复制代码
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

step 5

bash 复制代码
sudo usermod -aG docker ${USER}

step 6

bash 复制代码
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": [
    "https://registry.dockermirror.com",
	"https://docker.mirrors.ustc.edu.cn",
	"https://docker.nju.edu.cn",
	"https://docker.mirrors.ustc.edu.cn",
	"http://hub-mirror.c.163.com",
	"https://we7rwaj4.mirror.aliyuncs.com"
  ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

step 7

bash 复制代码
cd /usr/local/bin
sudo ln -s /usr/libexec/docker/cli-plugins/docker-compose docker-compose

参考文献

相关推荐
日取其半万世不竭5 小时前
用 Portainer 可视化管理 Docker:容器再多也不用背命令了
运维·docker·容器
啊啊啊迈 旋棍11 小时前
【译】TypeScript 7 测试版已在 Visual Studio 2026 18.6 Insiders 3 中默认启用
ubuntu·typescript·visual studio
weixin_4196583112 小时前
Docker 搭建 Jenkins 服务
java·docker·jenkins
BullSmall15 小时前
Tomcat 部署 Jenkins → Docker Jenkins 完整迁移方案
docker·tomcat·jenkins
Eloudy15 小时前
ubuntu 22.04安装 cuda 12.8.2
linux·运维·ubuntu
ruofu3316 小时前
下载nvidia_*_cu13的指令(更新:利用torch 版本拉取相关依赖)
docker·容器
独孤--蝴蝶16 小时前
Docker容器进阶(一)
运维·docker·容器
接针19 小时前
Pycharm远程连接Ubuntu的conda环境
ubuntu·pycharm·conda
冰封之寂19 小时前
Docker Compose 容器编排实战:从入门到 LNMP 环境部署-zabbix监控
docker·容器·zabbix
漂移的电子19 小时前
解决Vue3 + TypeScript + Vite搭建的项目,动态路由页面加载失败的最隐蔽原因
javascript·ubuntu·typescript