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

参考文献

相关推荐
Zhijun.li@Studio13 分钟前
【Docker实战】在容器内配置 SSH 服务:安装、Vim配置与连接验证(保姆级教程)
docker·ssh·vim
了一梨27 分钟前
使用Docker配置适配泰山派的交叉编译环境
linux·docker
GoWjw2 小时前
内存管理【3】
linux·服务器·c++·ubuntu
White-Legend2 小时前
支持docker一键部署了
运维·docker·容器
The star"'2 小时前
docker(6-10)
docker·容器·eureka
森G3 小时前
五、Linux字符设备驱动
linux·arm开发·c++·ubuntu
普罗米修斯Aaron_Swartz3 小时前
云主机(容器)内实现本地VNC访问
网络·docker
企鹅侠客3 小时前
Ubuntu本地部署AnythingLLM实现本地文档RAG
linux·运维·ubuntu·llm
森G4 小时前
六、imx6ull驱动实现
linux·c语言·ubuntu