第一步:kali添加Docker官方的GPG密钥
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add

第二步:进入root更新源:
su root
echo 'deb https://download.docker.com/linux/debian stretch stable'> /etc/apt/sources.list.d/docker.list

打开编辑deb https://download.docker.com/linux/debian stretch stables

第三步:导入证书:
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common


更新系统:
apt-get update
第四步:安装docker
sudo apt install docker.io

看是否安装成功:
docker -v

第五步:成功安装docker安装compose
apt install docker-compose
回车输入:
docker-compose
安装成功: