升级CentOS 7上的停靠点 [英] Upgrade docker on CentOS 7
问题描述
yum install epel-release
yum安装docker
但是Docker版本是 - $ code Docker版本0.11。 1-dev,build 02d20af / 0.11.1
Docker的最新稳定分支是1.2
我在这个主机上运行几个容器,那么我该如何在这个主机上安全地更新docker?
yum update docker不更新到最新版本作为epel repo有旧的包。
注意,目前稳定版本的Docker实际上是1.3, 1.2。请参阅 Docker CHANGELOG ,以发现最新版本。
在升级Docker主机之前,您可能需要备份一些您拥有的Docker映像,特别是从 docker c ommit
命令。为此,请查看停靠口导出命令。
您可能还需要备份容器的卷。为此,请查看 Docker用户指南数据卷。
一旦你有信心,你需要所有的备份,最终新的开始,你可以升级Docker守护进程。
在 CentOS 7的Docker安装指南,建议您从二进制文件如果你想要最新的。我建议您按照这些说明安装最新的Docker。 Docker现在通过 yum
包管理器提供更新。
一旦完成,使用 docker图像
命令来验证您是否仍然拥有Docker图像和 docker ps
检查您的容器。如果有些缺失,请从备份中重新创建它们。
如果您从自定义Dockerfiles创建了Docker映像,那么还需要重建这些映像,以检查Dockerfile是否有问题新的Docker守护进程。 Docker 0.11.1和1.3之间有一个大差距,修复和新功能被带到Dockerfiles语法。
这里有详细的命令,一旦你准备升级Docker :
#停止码头服务
$ sudo服务码头停止
#下载最新的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
#启动码头服务
$ sudo service docker start
#检查版本
$ sudo docker版本
#检查图像和容器
$ sudo docker图像
$ 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上的停靠点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!