前提:阿里云服务器,乌班图系统
首先,更新软件包索引,并且安装必要的依赖软件,来添加一个新的 HTTPS 软件源:
5 sudo apt update
6 sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
使用下面的 curl 导入源仓库的 GPG key:
7 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
将 Docker APT 软件源添加到你的系统:
8 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
安装最新docker(也可指定版本 略)
9 sudo apt install docker-ce docker-ce-cli containerd.io
一旦安装完成,Docker 服务将会自动启动。你可以输入下面的命令,验证它:
10 sudo systemctl status docker
11 docker ps -a
12 docker version
Docker-Compose 的安装 版本1.25.0
13 sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/