默认使用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. Java基础学习总结(44)——10个Java 8 Lambda表达式经典示例

    Java 8 刚于几周前发布,日期是2014年3月18日,这次开创性的发布在Java社区引发了不少讨论,并让大家感到激动.特性之一便是随同发布的lambda表达式,它将允许我们将行为传到函数里.在Ja ...

  2. cogs 141. [USACO Jan08] 奶牛的选举

    141. [USACO Jan08] 奶牛的选举 ★   输入文件:elect.in   输出文件:elect.out   简单对比时间限制:1 s   内存限制:16 MB 在推翻了Farmer J ...

  3. CentOS6.5安装redis(3.0.3)

      如果没有安装gcc需要安装gcc 才能编译成功 yum install gcc 离线安装gcc的方法 # rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm # rpm -i ...

  4. Android 解决TextVIew载入自己定义字体慢的问题

    网上非常多自己定义字体样式的代码.都是告诉应该这样做: 在自己定义控件里写,可是这样写有问题,会随着界面里自己定义控件越多.Activity载入速度越慢,太多了easy造成内存泄露问题,由于你没创建一 ...

  5. Android基础笔记(十三)- 内容提供者原理和简单使用

    为什么要有内容提供者 内容提供者的工作原理 使用内容解析者对内容提供者进行增删改查操作 利用内容提供者和内容解析者备份手机短信 利用内容提供者插入短信 为什么要有内容提供者 内容提供者技术的目的是: ...

  6. php通过shell调用Hadoop的方法

    1.php代码(index.php) <!DOCTYPE html> <html> <!-- <style> body{background-color:re ...

  7. 三层登录—c#

    学习了三层,有一个登录窗口的小练习.是我们第一次接触三层的初战.如今仅仅是简单的了解了一些,须要学习的还有非常多,以下浅谈自己的理解. 我们说的三层就是分层了显示层.业务逻辑层和数据訪问层.当中显示层 ...

  8. 二维码框架ZBarSDK的使用和自己定义二维码扫描界面方法

    假设你不知道ZBarSDK怎么用,请下载demo http://download.csdn.net/detail/u013686641/7858917 假设你已经配置好ZBarSDK .那么以下这个类 ...

  9. bzoj1029: [JSOI2007]建筑抢修(堆+贪心)

    1029: [JSOI2007]建筑抢修 题目:传送门 题解: 一道以前就做过的水题(找个水题签个到嘛...) 很明显就是一道贪心题,这里我们用一个堆来维护 具体看代码吧,很容易YY所以不讲 代码: ...

  10. zzulioj--1804--ZY学长的密码(字符串)

    1804: ZY学长的密码 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 140  Solved: 53 SubmitStatusWeb Board ...