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

参考文献

相关推荐
Y3815326628 小时前
Docker Compose 服务依赖与健康检查:healthcheck 让容器按正确顺序启动
运维·docker·容器
2601_9652354810 小时前
快速了解docker
docker·容器·dubbo
李昊哲小课10 小时前
Deepin 25 上安装 Docker CE 实战记录
运维·docker·容器·deepin
pingglala10 小时前
ubuntu-nat模式不能上网解决方法
linux·运维·ubuntu
微软技术分享11 小时前
Ubuntu 本地部署Ollama+OpenWebUI教程
数据库·ubuntu·postgresql
重生之我来学Python13 小时前
Docker套装的简介、安装、超级详细教程
linux·docker·容器·eureka·github
起名真的太难了16 小时前
Docker 项目部署
docker·容器·eureka
一叶龙洲17 小时前
Ubuntu从图标到卸载应用
linux·windows·ubuntu
狼与自由17 小时前
docker 安装milvus
docker·milvus
头发够用的程序员17 小时前
别被 TOPS 参数迷惑:手把手推导边缘 GPU 整型算力
人工智能·python·ubuntu·计算机视觉·硬件架构·边缘计算