更新 Apt source
sudo apt-get update
安装辅助软件包
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
添加秘钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
添加 Docker 仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
更新源, 安装 Docker-ce
sudo apt-get update
sudo apt-get install docker-ce
查看 docker 是否安装成功
docker -v
添加当前用户到docker 用户组
sudo usermod -aG docker ${USER}
安装 docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
查看 docker-compose 是否安装成功
docker-compose --version
安装完成, 重启系统.
网友评论