1、升级docker compose ,docker官方安装方法
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
这个下载过程会比较慢
修改权限
$ sudo chmod +x /usr/local/bin/docker-compose
查看版本
$ docker-compose -version
docker-compose version 1.24.1, build 4667896b
docker compose file对应版本
Compose file format compatibility matrix
Compose file format | Docker Engine |
---|---|
1 | 1.9.0+ |
2.0 | 1.10.0+ |
2.1 | 1.12.0+ |
2.2, 3.0, 3.1, 3.2 | 1.13.0+ |
2.3, 3.3, 3.4, 3.5 | 17.06.0+ |
2.4 | 17.12.0+ |
3.6 | 18.02.0+ |
3.7 | 18.06.0+ |
2、升级docker,docker官方升级方法
a、先卸载旧版本并更新系统
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \ curl \ gnupg2 \ software-properties-common
b、安装密钥管理与下载相关的工具
$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg2 \ software-properties-common
c、下载并安装密钥
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
安装完之后会提示“OK”,
d、查看密钥是否安装成功,成功提示内容
dongge@dongge-PC:~$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ 未知 ] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
e、在 source.list 中添加 docker-ce 软件源
sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian wheezy stable" // 官方源 // sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian wheezy stable" // 15.11 会提示 aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Deepin/stable // 这里我们通过编辑 sudo vim /etc/apt/sources.list 添加一行即可,原因未知 sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable"
f、再次更新系统
$ sudo apt-get update
g、安装docker ce
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
安装成功之后,查看docker版本
dongge@dongge-PC:~$ docker version Client: Docker Engine - Community Version: 19.03.1 API version: 1.40 Go version: go1.12.5 Git commit: 74b1e89 Built: Thu Jul 25 21:22:03 2019 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.1 API version: 1.40 (minimum version 1.12) Go version: go1.12.5 Git commit: 74b1e89 Built: Thu Jul 25 21:20:35 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.6 GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc: Version: 1.0.0-rc8 GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f docker-init: Version: 0.18.0 GitCommit: fec3683