查看版本号
> docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-162.git64e9980.el7.centos.x86_64
Go version: go1.10.3
Git commit: 64e9980/1.13.1
Built: Wed Jul 1 14:56:42 2020
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-162.git64e9980.el7.centos.x86_64
Go version: go1.10.3
Git commit: 64e9980/1.13.1
Built: Wed Jul 1 14:56:42 2020
OS/Arch: linux/amd64
Experimental: false
升级
1.卸载旧docker
systemctl stop docker
> yum erase docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine \
docker-ce
rpm -qa | grep docker
find /etc/systemd -name '*docker*' -exec rm -f {} \;
find /etc/systemd -name '*docker*' -exec rm -f {} \;
find /lib/systemd -name '*docker*' -exec rm -f {} \;
rm -rf /var/lib/docker #删除以前已有的镜像和容器,非必要
rm -rf /var/run/docker
2.安装docker
- daocloud 源,适用于Ubuntu,Debian,Centos等大部分Linux,会3小时同步一次Docker官方资源
curl -sSL https://get.daocloud.io/docker | sh
- 阿里源
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet| sh
- 查看docker版本 19.03.12
3.安装 Docker Compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- 查看Docker Compose版本 1.26.2, build eefe0d3
docker-compose version
4.启动docker并设置为开机启动
//启动
systemctl start docker
//开机自启动
systemctl enable docker