安装方法类似于debian8
可以看链接:https://blog.csdn.net/weixin_44039162/article/details/105952882
我简单描写一下步骤:
1.更新apt-get,配置环境。
apt-get update
apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
2.添加ssl的key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
验证:apt-key fingerprint 0EBFCD88
结果:
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb) <docker@docker.com>
sub 4096R/F273FCD8 2017-02-22
3.设置库
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
PS:其中amd64/armhf/arm64有区别需要注意。
4.安装docker
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io
5.安装docker-compose
1.安装docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
2.更改权限
chmod +x /usr/local/bin/docker-compose
3.查看版本
docker-compose --version
PS:docker-compose版本可能会更新,可查看官网:
https://docs.docker.com/compose/install/