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

参考文献

相关推荐
间彧2 分钟前
docker中如何使用Arthas诊断工具
docker
LuckyLay1 小时前
Ubuntu配置多版本Java,自由切换
java·linux·ubuntu
rustfs1 小时前
使用 RustFS和 Arq,打造 PC 数据安全备份之道
分布式·docker·云原生·rust·开源
HIT_Weston2 小时前
99、【Ubuntu】【Hugo】搭建私人博客:搜索功能(三)
linux·运维·ubuntu
橙子❦2 小时前
官网下载docker--centos容器,后安装并启动容器
docker·容器·centos
自己的九又四分之三站台2 小时前
Docker + Ollama 大模型管理
docker·容器·eureka
小钱c72 小时前
记录一次WSL修改networkingMode导致Docker端口无法访问的问题
运维·docker·容器
deng-c-f3 小时前
配置(13):给Vmware中的ubuntu扩容(只适用LVM分区)
linux·运维·ubuntu
懒人村杂货铺3 小时前
从 Permission Denied 到 404:Docker 多容器下图片上传与静态资源服务全解
docker·fastapi
ICT董老师3 小时前
在Ubuntu 22.04上使用GitLab和Jenkins部署CI/CD的完整过程
ubuntu·ci/cd·kubernetes·gitlab·jenkins