1、添加docker源
sudo cat >/etc/apt/sources.list.d/docker-main.list< deb [arch=amd64] http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial main EOF 2、Add Docker’s official GPG key: apt install curl curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add - 3、更新源和升级系统 apt-get update 4、如果存在旧版本,则卸载旧版本docker apt-get purge lxc-docker* 5、列出docker版本 apt-cache policy docker-engine docker-engine: Installed: (none) Candidate: 17.05.0~ce-0~ubuntu-xenial Version table: 17.05.0~ce-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 17.04.0~ce-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 17.03.1~ce-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 17.03.0~ce-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.13.1-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.13.0-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.6-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.5-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.4-0~ubuntu-xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.3-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.2-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.1-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.12.0-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.11.2-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.11.1-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 1.11.0-0~xenial 500 500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages 6、安装指定版本 apt-get install -y docker-engine=17.03.1~ce-0~ubuntu-xenial 7.离线安装docker-compose 7.1 下载docker-compose文件 wget -c https://github.com/docker/compose/releases/download/1.13.0/docker-compose-Linux-x86_64 7.2 移动docker-compose到/usr/local/bin/docker-compose mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose 7.3修改权限 sudo chmod +x /usr/local/bin/docker-compose docker-compose -f docker.yml up