装之前可以选择更新一下软件库
┌──(root㉿kali)-[~]
└─# apt update
安装docker
┌──(root㉿kali)-[~]
└─# apt install docker.io
┌──(root㉿kali)-[~]
└─# docker version # 查看Docker版本
┌──(root㉿kali)-[~]
└─# apt install docker-compose # 安装Docker-compose
┌──(root㉿kali)-[~]
└─# docker-compose version # 查看docker-compose版本
┌──(root㉿kali)-[/etc/apt/sources.list.d]
└─# cd /etc/docker
┌──(root㉿kali)-[/etc/docker]
└─# vim docker.json
下面添加的是中科大的镜像源
{
2 "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
3 }
设置docker开机自启
┌──(root㉿kali)-[~]
└─# systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker