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

参考文献

相关推荐
java_logo2 小时前
Docker 部署 EmulatorJS:轻松搭建浏览器复古游戏平台
游戏·docker·容器·复古游戏·轩辕镜像·emulatorjs·红白机
方便面不加香菜4 小时前
Docker Container --容器及容器的操作案例详解
运维·docker·容器
无人生还别怕10 小时前
如何搭建docker仓库(轻量级)registry
linux·运维·docker·云原生·容器·registry·openanolisos
David猪大卫20 小时前
【Linux修炼】环境变量、进程地址空间
linux·c语言·经验分享·笔记·学习·ubuntu·centos
YYYing.1 天前
【K8s系列 (一) 】Docker与容器(上篇)
docker·云原生·容器·kubernetes
csdn_aspnet1 天前
使用 Docker 和 RedisInsight 设置 Redis 以进行本地开发
redis·docker·容器·redisinsight
余槐i1 天前
MySQL 8.0 联合索引走错:为什么加了索引查询反而从 200ms 变成 8s
java·spring boot·mysql·docker·性能优化
csdn_aspnet1 天前
如何在本地 Docker 容器中运行 Redis,并使用 Redis Insight 和 Redis CLI 进行管理
redis·docker·容器
且从容.1 天前
Ubuntu 安装 Docker
linux·ubuntu·docker
todoitbo1 天前
我在 Mac 上用 Docker 部署 Nexent:从拉取镜像到接入模型
macos·docker·大模型·ai智能体·nexent·快速入门与环境准备