在CentOS 7上升级docker [英] Upgrade docker on CentOS 7

查看:161
本文介绍了在CentOS 7上升级docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行centos 7并使用epel软件包在主机上安装了docker:

  yum安装epel-release 
yum install docker

但是Docker版本是 - Docker版本0.11。 1-dev,build 02d20af / 0.11.1



docker的最新稳定版本是1.2



我在这台主机上运行几个容器,那么如何在这个主机上安全地更新docker?



yum更新docker不会更新到

解决方案

请注意,当前稳定版本的Docker实际上是1.3,而不是1.2。查看 Docker CHANGELOG 以发现最新版本。



在升级docker主机之前,您可能需要备份一些docker镜像,特别是从 docker commit 命令。要执行此操作,请查看 docker export 命令。
您可能还需要备份容器的卷。有关详情,请参阅 Docker数据用户指南卷



一旦您确信自己拥有了最终全新的启动所需的所有备份,就可以升级Docker守护进程。



适用于CentOS 7的Docker安装指南建议从二进制文件如果你想要最新的。我建议你按照这些说明安装最新的docker。 Docker现在通过 yum 包管理器提供更新。

完成后,使用 docker images 命令验证您是否仍然拥有Docker镜像和 docker ps 以检查您的容器。



如果您从自定义Dockerfiles创建了docker镜像,您还需要重建这些镜像以检查没有Dockerfile有问题新的Docker守护进程。 Docker 0.11.1和1.3之间存在大差距,修复和新的功能带来了Dockerfiles语法。






详细这里是一旦你准备好升级docker :

 #停止docker服务
$ sudo service docker stop

#下载最新的docker二进制和替换当前过时的docker
#DEPRECATED的方式升级DOCKER:$ sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O / usr / bin / docker
$ sudo yum update docker-engine

#启动docker服务
$ sudo服务docker启动

#检查版本
$ sudo docker版本

#检查映像和容器
$ sudo docker images
$ sudo docker ps
$ sudo docker ps -a


I'm running centos 7 and have installed docker on host using epel packages:

yum install epel-release
yum install docker

But the docker version is-Docker version 0.11.1-dev, build 02d20af/0.11.1

The latest stable branch of docker is 1.2

I'm running couple of containers on this host, so how can i update docker safely on this host?

yum update docker does not update to the latest version as the epel repo has old package.

解决方案

Note that current stable version of Docker is actually 1.3, not 1.2. See the Docker CHANGELOG to discover the latest version.

Before upgrading your docker host, you might want to backup some of the docker images you have, especially those issued from the docker commit command. To do so, take a look at the docker export command. You might also want to backup your containers' volumes. For that take a look at the Docker user guide on data volumes.

Once you are confident you have all the backups you need for an eventual fresh start you can move on upgrading your Docker daemon.

On the Docker installation guide for CentOS 7, it is advised to install docker from the binaries if you want the latest. I suggest you follow those instructions to install the latest docker. Docker now provides updates through the yum package manager.

Once done with that use the docker images command to verify if you still have your Docker images and docker ps to check your containers. If some are missing, recreate them from your backups.

If you created docker images from custom Dockerfiles, you also want to rebuild those images to check that no Dockerfile has issues with the new Docker daemon. There is a big gap between Docker 0.11.1 and 1.3 and fixes and new features were brought to the Dockerfiles syntax.


In details here are the commands to run once you are ready to upgrade docker:

# stop the docker service
$ sudo service docker stop

# download the latest docker binary and replace the current outdated docker
# DEPRECATED WAY TO UPGRADE DOCKER: $ sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
$ sudo yum update docker-engine

# start the docker service
$ sudo service docker start

# check the version
$ sudo docker version

# check the images and containers
$ sudo docker images
$ sudo docker ps
$ sudo docker ps -a

这篇关于在CentOS 7上升级docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆