默认使用yum或者apt安装的docker版本较老,可以通过以下方式进行升级:

1、卸载旧版本

[root@CentOS702 ~]# centos 7.3卸载docker
[root@CentOS702 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@CentOS702 ~]# rpm -qa | grep docker
docker-client-1.12.6-11.el7.centos.x86_64
docker-common-1.12.6-11.el7.centos.x86_64
docker-1.12.6-11.el7.centos.x86_64
[root@CentOS702 ~]# yum remove -y -q docker-client docker-common docker
[root@CentOS702 ~]# ubuntu 16.10卸载docker
liuyongsheng@ubuntu:~$ dpkg -l | grep docker
ii  docker.io                                  1.12.6-0ubuntu1~16.10.1                 amd64        Linux container runtime
liuyongsheng@ubuntu:~$ sudo apt-get --purge remove docker.io

2、安装最新版

[root@CentOS702 ~]# 可通过docker官方/阿里云/daocloud的安装脚本安装,适用于CentOS、Ubuntu、Debian等大部分linux系统
[root@CentOS702 ~]# curl -sSL https://get.docker.com/ | sh
[root@CentOS702 ~]# curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
[root@CentOS702 ~]# curl -sSL https://get.daocloud.io/docker | sh
[root@CentOS702 ~]# systemctl start docker
[root@monitor ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@CentOS702 ~]# docker -v
Docker version 17.03.0-ce, build 60ccb22
[root@CentOS702 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0ef2e08ed3fa 3 weeks ago 130 MB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
[root@monitor ~]# CentOS系统也可配置官方源安装最新版,其它系统源地址参考:https://yum.dockerproject.org/repo/
[root@monitor ~]# uname -r
3.10.0-514.el7.x86_64
[root@monitor ~]# yum update -y -q
[root@monitor ~]# tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
[root@monitor ~]# yum install -y docker-engine
[root@monitor ~]# systemctl start docker
[root@monitor ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@monitor ~]# docker -v
Docker version 17.03.0-ce, build 60ccb22
[root@monitor ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world         latest              48b5124b2768        2 months ago        1.84 kB

3、配置阿里云加速器

[root@CentOS702 ~]# mkdir -p /etc/docker
[root@CentOS702 ~]# 配置/etc/docker/daemon.json方式适用于docker1.10以上版本,其它版本参考阿里云配置文档
[root@CentOS702 ~]# tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
EOF
{
"registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
[root@CentOS702 ~]# systemctl daemon-reload
[root@CentOS702 ~]# systemctl restart docker
[root@CentOS702 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0ef2e08ed3fa 3 weeks ago 130 MB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
[root@CentOS702 ~]# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
785fe1d06b2d: Pull complete
Digest: sha256:be5b4a93f116a57ab3fd454ada72421eac892a3a4925627ac9a44f65fcd69cf8
Status: Downloaded newer image for centos:latest
[root@CentOS702 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 98d35105a391 5 days ago 192 MB
ubuntu latest 0ef2e08ed3fa 3 weeks ago 130 MB
hello-world latest 48b5124b2768 2 months ago 1.84 kB

4、Docker Hub Mirror

阿里云:https://dev.aliyun.com/search.html  

DaoCloud:https://www.daocloud.io/mirror

5、参考网址

docker镜像源&加速器:

http://warjiang.github.io/devcat/2016/11/28/使用阿里云Docker镜像加速/

http://lx.wxqrcode.com/index.php/post/111.html

http://www.cnblogs.com/anliven/p/6218741.html

docker升级&加速器配置的更多相关文章

  1. Docker镜像加速器配置

    一.为什么要配置Docker镜像加速器 因为我们默认pull的docker镜像是从Docker Hub来下载,由于其服务器在国外,速度会比较慢.因此我们可以配置成国内的镜像仓库,这样可以加速镜像的上传 ...

  2. centos7 docker镜像加速器配置

    CentOS的配置方式略微复杂,需要先将默认的配置文件复制出来 /lib/systemd/system/docker.service -> /etc/systemd/system/docker. ...

  3. docker 国内加速器配置

    配置镜像加速器 阿里云 登录到 阿里云获取到专属加速地址bqr1dr1n.mirror.aliyuncs.com 找到服务 deamon.js 所在目录C:\ProgramData\docker\co ...

  4. Coreos配置docker镜像加速器

    CoreOS配置docker镜像加速器 CoreOS下的Docker配置是通过flannel unit来实现的. 1) 通过命令 systemctl cat docker 可以看出配置文件的默认位置 ...

  5. CentOS上安装 Docker-CE以及Docker 加速器配置

    在CentOS 7.0上安装 Docker-CE 官方源安装教程 https://docs.docker.com/install/linux/docker-ce/centos/#install-usi ...

  6. 配置Docker镜像加速器

    由于在国内下载docker官方镜像的速度很慢且容易报错,因此需要配置docker镜像加速器来解决这个问题,加速器就是镜像代理的概念,只代理公有镜像,报错结果如下: net/http: request ...

  7. docker 升级后,配置 idea 连接 docker

    [root@A01-R02-I188-87 ~]# docker version Client: Version: 18.06.1-ce API version: 1.24 Go version: g ...

  8. docker加速器配置

    我使用docker的原因 最近自己一直在强迫自己使用docker,一方面是docker的容器化服务,使得每一个配置相互独立,易于维护.而且如果到后面如果深入了的话,通过自己编写dockerfile,那 ...

  9. k8s集群之Docker安装镜像加速器配置与k8s容器网络

    安装Docker 参考:https://www.cnblogs.com/rdchenxi/p/10381631.html 加速器配置 参考:https://www.cnblogs.com/rdchen ...

随机推荐

  1. CodeForces - 552E Vanya and Brackets

    Vanya and Brackets Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u ...

  2. 转:强制Visual Studio以管理员身份运行

    Windows 8的一个既安全又蛋疼之处是UAC的行为被改变了.以往在Windows 7中,只要关闭了UAC,自己的帐号又是本机管理员组的,任何程序都会以管理员身份启动.然而,在Windows 8上, ...

  3. RIP协议的配置

    拓扑图: 要求: 理解RIP协议的工作原理,并通过 RIP 路由协议实现不同网络互通. 配置步骤: 1.配置好 PC 机的 IP 地址等參数. PC 0>ipconfig IP Address. ...

  4. 对象逆序列化报错:java.lang.ClassNotFoundException

    简单的想从保存的对象中又一次解析出对象.用了逆序列化,但是报错: java.lang.ClassNotFoundException: xxxxxxxxxxxx at java.net.URLClass ...

  5. JConsole远程监控Tomcat7

    下面技术应用于最优质的水果的鲜果篮 一.设置服务端: 1.增加Listener到conf/server.xml <Listener className="org.apache.cata ...

  6. 《鸟哥的Linux私房菜-基础学习篇(第三版)》(三)

    第2章 Linxu怎样学习         1. Linux当前的应用角色 当前的Linux常见的应用可略分为企业应用和个人应用双方面. 首先谈了企业环境的利用. 1)网络server. 2)关键任务 ...

  7. Vue小技巧,如何导入普通JS文件

    最近在开发一个展示3D模型的WEB程序,在工程中使用了VUE和ThreeJS库.Three.js本身是支持CommonJS的,但我们还用到了OBJLoader模块,此模块不支持CommonJS,改成C ...

  8. centos7 配置redis

    文件上传 yum -y install lrzsz 安装redis部署前操作 同时下载redis-.tar.gz安装包 yum -y install gcc-c++ yum -y install tc ...

  9. Random words

    To choose a random word from the histogram, the simplest algorithm is to build a list with multiple ...

  10. The python programing language

    Python is an example of high-level language. As you might infer from the name “high-level language”, ...