官方参考文档:Install Docker Engine on Debian
设置存储库
- 下载所需工具:
sudo apt update && sudo apt install ca-certificates curl gnupg lsb-release -y
- 添加 Docker 的官方 GPG 密钥
sudo mkdir -p /etc/apt/keyrings && cd /etc/apt/keyrings
- 添加Docker存储库
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- 设置Docker密钥权限
sudo chmod a+r /etc/apt/keyrings/docker.gpg
安装 Docker 引擎
- 更新Docker软件包索引
sudo apt-get update
- 安装Docker最新软件包
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
- Docker验证
sudo docker info #查看Docker详细信息
sudo docker compose version #查看Docker commpose版本
#输出信息
#sudo docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.12.2)
scan: Docker Scan (Docker Inc., v0.21.0)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.21
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.10.0-19-amd64
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.904GiB
Name: debian
ID: WWW2:NYGC:EX4I:L4C2:KOYC:D4DW:37Q7:3PYZ:YN63:SSDH:2QAK:747Q
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
#sudo docker compose version
Docker Compose version v2.12.2
标签:sudo,apt,etc,version,Docker,安装,docker
From: https://www.cnblogs.com/c0ldzera/p/16945418.html