一、安装docker
1、添加Docker pgp key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
2、添加docker源
echo -e 'deb https://download.docker.com/linux/debian stretch stable' > /etc/apt/sources.list.d/docker.list
3、更新源
apt update --fix-missing
4、清理之前的docker
apt remove docker docker-engine docker.io -y
5、安装docker-ce
apt install docker-ce -y
6、测试安装是否成功
docker --version
二、安装docker-compose
curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
测试是否成功
docker-compose --version