赞
踩
dockerd
):负责管理 Docker 容器的后台进程。docker
):用于与 Docker Daemon 交互的命令行接口。- # 更新包列表
- sudo apt-get update
- # 安装依赖工具
- sudo apt-get install ca-certificates curl
- # 创建目录
- sudo install -m 0755 -d /etc/apt/keyrings
- # 下载Docker的GPG密钥(使用阿里云的链接)
- sudo curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
- # 设置密钥权限
- sudo chmod a+r /etc/apt/keyrings/docker.asc
- echo \
- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] http://mirrors.aliyun.com/docker-ce/linux/ubuntu \
- $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
- sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo vim /etc/docker/daemon.json
- {
- "registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"]
- }
sudo service docker restart
- sudo usermod -aG docker $USER
- # 重新登录以使更改生效
- newgrp docker
docker run hello-world
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。