docker升级&加速器配置
默认使用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升级&加速器配置的更多相关文章
- Docker镜像加速器配置
一.为什么要配置Docker镜像加速器 因为我们默认pull的docker镜像是从Docker Hub来下载,由于其服务器在国外,速度会比较慢.因此我们可以配置成国内的镜像仓库,这样可以加速镜像的上传 ...
- centos7 docker镜像加速器配置
CentOS的配置方式略微复杂,需要先将默认的配置文件复制出来 /lib/systemd/system/docker.service -> /etc/systemd/system/docker. ...
- docker 国内加速器配置
配置镜像加速器 阿里云 登录到 阿里云获取到专属加速地址bqr1dr1n.mirror.aliyuncs.com 找到服务 deamon.js 所在目录C:\ProgramData\docker\co ...
- Coreos配置docker镜像加速器
CoreOS配置docker镜像加速器 CoreOS下的Docker配置是通过flannel unit来实现的. 1) 通过命令 systemctl cat docker 可以看出配置文件的默认位置 ...
- CentOS上安装 Docker-CE以及Docker 加速器配置
在CentOS 7.0上安装 Docker-CE 官方源安装教程 https://docs.docker.com/install/linux/docker-ce/centos/#install-usi ...
- 配置Docker镜像加速器
由于在国内下载docker官方镜像的速度很慢且容易报错,因此需要配置docker镜像加速器来解决这个问题,加速器就是镜像代理的概念,只代理公有镜像,报错结果如下: net/http: request ...
- docker 升级后,配置 idea 连接 docker
[root@A01-R02-I188-87 ~]# docker version Client: Version: 18.06.1-ce API version: 1.24 Go version: g ...
- docker加速器配置
我使用docker的原因 最近自己一直在强迫自己使用docker,一方面是docker的容器化服务,使得每一个配置相互独立,易于维护.而且如果到后面如果深入了的话,通过自己编写dockerfile,那 ...
- k8s集群之Docker安装镜像加速器配置与k8s容器网络
安装Docker 参考:https://www.cnblogs.com/rdchenxi/p/10381631.html 加速器配置 参考:https://www.cnblogs.com/rdchen ...
随机推荐
- hadoop-12-安装ambari-agent
hadoop-12-安装ambari-agent 在所有的机器上面安装ambari-agent 1, cd /etc/yum.repos.d/vi 三个文件vi ambari.repo#VERSION ...
- 程序设计基石与实践系列之编写高效的C程序与C代码优化
原文出处: codeproject:Writing Efficient C and C Code Optimization 虽然对于优化C代码有非常多有效的指导方针,可是对于彻底地了解编译器和你工作的 ...
- [数位dp] bzoj 3209 花神的数论题
题意:中文题. 思路:和普通数位dp一样,这里转换成二进制,然后记录有几个一. 统计的时候乘起来就好了. 代码: #include"cstdlib" #include"c ...
- 【HDU-4614】Vases and Flowers(线段树双查询)
11946317 2014-10-23 09:08:28 Accepted 4614 437MS 2348K rid=11946317" target="_blank" ...
- USACO Section 1.3 : Calf Flac (calfflac)
题意:据说假设你给无限仅仅母牛和无限台巨型便携式电脑(有很大的键盘),那么母牛们会制造出世上最优秀的回文. 你的工作就是去寻找这些牛制造的奇观(最优秀的回文). 在寻找回文时不用理睬那些标点符号.空格 ...
- codeforces@281 B
shui #include<iostream> #include<cstdio> #include<cstring> #include<algorithm&g ...
- 关于fetch
前言: fetch是用来取代传统的XMLHttpRequest的. 它的优点很多,包括链式调用的语法.返回promise等. 什么是fetch? fetch api是基于promise的设计,它是为了 ...
- Java基础学习(三) -- OOP的三大特征、向上和向下转型、内部类之详解
面向对象编程(OOP)的三大特征 什么是封装? (1) 把对象的状态和行为看成一个统一的整体,将二者存放在一个独立的类中; (2) "信息隐藏", 把不需要让外界知道的信息隐藏起来 ...
- Android属性动画-Interpolator和ViewPropertyAnimator的用法
Interpolator的用法 Interpolator这个东西很难进行翻译,直译过来的话是补间器的意思,它的主要作用是可以控制动画的变化速率,比如去实现一种非线性运动的动画效果.那么什么叫做非线性运 ...
- 关于Mantle使用个人的一些见解
前一个月,我接触到了Mantle,由于项目采用的是MVC的设计模式,选用好的model也是至关重要的.先介绍下Mantle的使用吧. 首先定义好数据模型: @property (nonatomic, ...