mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-22 23:00:57 +08:00
translated wi-cuckoo
This commit is contained in:
parent
f825296761
commit
32996ca88c
@ -1,168 +0,0 @@
|
||||
translating wi-cuckoo
|
||||
Docker 1.6 Released - How to Upgrade on Fedora / CentOS
|
||||
================================================================================
|
||||
Docker, a popular open source container platform for packaging applications, has a new release 1.6 with lot of new features in it. This version has updates to Docker Registry, Engine, Swarm, Compose and Machine. The release aims at improvements in performance, developer and system administrator experiences. Let us take a quick look at the new features available.
|
||||
|
||||
**Docker Registry (2.0)** which is a service for pushing Docker images for storing and sharing, has undergone architectural changes as it was facing performance issues when under load. It is still backward compatible. The language in which Docker Registry is written is now changed from Python to Google's Go to improve performance. In combination with Docker Engine 1.6, it is capable of pulling the images faster. Earlier the images were delivered sequentially, but now in parallel.
|
||||
|
||||
**Docker Engine (1.6)** is greatly improved from its previous version. It supports containers and image labels. With labels you can attach user-defined metadata to images and containers which in turn can be used by other tools. Labels will not be visible to the running applications and can be used to speed up the searching of containers and images.
|
||||
|
||||
There is a Windows version of the Docker client which can connect to a remote Docker engine that runs Linux.
|
||||
|
||||
Docker now supports logging driver API that allows us to send container logs to systems like Syslog or to a third-party. It is going to be benefitting the system administrators.
|
||||
|
||||
**Swarm (0.2)** is a clustering tool for Docker which turns a pool of Docker hosts into one virtual host. In the new feature, containers are evenly placed on the available nodes. Effort is made towards supporting the complete Docker API by adding more Docker commands. In the future, it will be possible to use third-party drivers for clustering.
|
||||
|
||||
**Compose (1.2)** which is a tool for defining and running complex applications in Docker has also got an upgrade. In the new version, one can create multiple sub-files instead of one flat file to describe a multi-container application.
|
||||
|
||||
With **Machine (0.2)**, we can easily create Docker hosts on local computers, clouds and data centers. The new release provides a cleaner driver interface to write drivers for providers. Provisioning is handled centrally by Machine instead of each individual driver. New command added to regenerate host's TLS certificates which increases security.
|
||||
|
||||
### Upgrade instructions on Fedora / CentOS ###
|
||||
|
||||
In this section, let us learn how to upgrade the existing docker version to the latest on Fedora and CentOS. Please note that currently Docker runs only on 64-bit architecture. As both Fedora and CentOS are from RedHat, commands used are pretty much identical except that the Docker package in Fedora20 and CentOS6.5 is called “docker-io”.
|
||||
|
||||
If you do not already have Docker installed on the system, install it using:
|
||||
|
||||
"yum install docker-io" – on Fedora20 / CentOS6.5
|
||||
|
||||
"yum install docker" - on Fedora21 / CentOS7
|
||||
|
||||
Before upgrading, it is good to have a backup of the docker images and container volumes.
|
||||
|
||||
Refer [filesystem to a tar archive][1] and [volumes backups, restores or migrations options][2] for more details.
|
||||
|
||||
Currently the test system has Docker version 1.5 installed. Output shown in the examples are from a Fedora 20 system.
|
||||
|
||||
Verify the current version of Docker installed on the system
|
||||
|
||||
[root@TestNode1 ~]#sudo docker -v
|
||||
|
||||
Docker version 1.5.0, build a8a31ef/1.5.0
|
||||
|
||||
If the Docker service is running, first stop it.
|
||||
|
||||
[root@TestNode1 ~]# sudo systemctl stop docker
|
||||
|
||||
Upgrade to the latest version using yum update. But at the time of writing this article, the repositories were not yet updated with the latest version(1.6). Hence you need to use the binary method of upgradation.
|
||||
|
||||
[root@TestNode1 ~]#sudo yum -y update docker-io
|
||||
|
||||
No packages marked for update
|
||||
|
||||
[root@TestNode1 ~]#sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
|
||||
|
||||
--2015-04-19 13:40:48-- https://get.docker.com/builds/Linux/x86_64/docker-latest
|
||||
|
||||
Resolving get.docker.com (get.docker.com)... 162.242.195.82
|
||||
|
||||
Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected.
|
||||
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
|
||||
Length: 15443598 (15M) [binary/octet-stream]
|
||||
|
||||
Saving to: /usr/bin/docker
|
||||
|
||||
100%[======================================>] 15,443,598 8.72MB/s in 1.7s
|
||||
|
||||
2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved
|
||||
|
||||
Check the updated version
|
||||
|
||||
[root@TestNode1 ~]#sudo docker -v
|
||||
|
||||
Docker version 1.6.0, build 4749651
|
||||
|
||||
Restart the docker service
|
||||
|
||||
[root@TestNode1 ~]# sudo systemctl start docker
|
||||
|
||||
Verify that Docker is working
|
||||
|
||||
[root@TestNode1 ~]# docker images
|
||||
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
|
||||
fedora latest 834629358fe2 3 months ago 241.3 MB
|
||||
|
||||
[root@TestNode1 ~]# docker run fedora /bin/echo Hello World
|
||||
|
||||
Hello World
|
||||
|
||||
**Note** on CentOS installation , after installing Docker on CentOS, you might get error messages like the following while trying to start the Docker service
|
||||
|
||||
docker.service - Docker Application Container Engine
|
||||
|
||||
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
|
||||
|
||||
Active: failed (Result: exit-code) since Mon 2015-04-20 03:24:24 EDT; 6h ago
|
||||
|
||||
Docs: http://docs.docker.com
|
||||
|
||||
Process: 21069 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127)
|
||||
|
||||
Main PID: 21069 (code=exited, status=127)
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Starting Docker Application Container E.....
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)"
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)"
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: /usr/bin/docker: relocation error: /...ce
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: docker.service: main process exited, co.../a
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Failed to start Docker Application Cont...e.
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state.
|
||||
|
||||
This is a known bug ( [https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3] ) and needs an upgrade of the device mapper to the latest level.
|
||||
|
||||
[root@centos7 ~]# rpm -qa device-mapper
|
||||
|
||||
device-mapper-1.02.84-14.el7.x86_64
|
||||
|
||||
[root@centos7 ~]# yum update device-mapper
|
||||
|
||||
[root@centos7 ~]# rpm -qa device-mapper
|
||||
|
||||
device-mapper-1.02.93-3.el7.x86_64
|
||||
|
||||
[root@centos7 ~]# systemctl start docker
|
||||
|
||||
### Summary ###
|
||||
|
||||
Though the docker technology is quite recent one, it is quickly gaining popularity. It has made life easy for developers and ops teams to quickly create and deploy applications respectively. With the company releasing quick updates to Docker in order to improve the product and address customer requirements, the future is definitely bright for Docker.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://docs.docker.com/reference/commandline/cli/#export
|
||||
[2]:http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes
|
||||
[3]:https://bugzilla.redhat.com/show_bug.cgi?id=1207839
|
||||
[4]:
|
||||
[5]:
|
||||
[6]:
|
||||
[7]:
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
@ -0,0 +1,167 @@
|
||||
Docker 1.6 发布 - 如何在Fedora / CentOS上面升级
|
||||
=============================================================================
|
||||
Docker,一个为软件打包的流行开源容器平台,有了新的发行版1.6,增加了许多新的特性。该版本在Docker注册,引擎,云集,组合和机器方面都有更新。这次发行旨在提升体验,开发者和系统管理员的经验(这里不太确定)。让我们来快速看看有哪些新特性吧。
|
||||
|
||||
**Docker Registry (2.0)**是一项推送Docker镜像用于存储和分享的服务,经历过架构的改变,因为面临加载下的体验问题。它仍然向下兼容。Docker Registry的编写语言现在从Python改为Google的Go语言了,为了提升表现力。与Docker引擎1.6结合后,拉取镜像的能力更快了。早先的镜像被队列式地输送,而现在是并行的啦。
|
||||
|
||||
**Docker Engine (1.6)**相比之前的版本有很大的提高。目前支持容器与镜像标签。通过标签,你可以附加用户自定义的元数据到镜像和容器上,而镜像和容器反过来可以被其他工具使用。标签对正在运行的应用是不可见的,可以用来加速搜索容器和镜像。
|
||||
|
||||
Windows版本的Docker客户端可以连接一个远程的运行linux的Docker引擎。
|
||||
|
||||
Docker目前支持日志驱动API,这允许我们发送容器日志给系统如Syslog,或者第三方。这将会使得系统管理员受益。
|
||||
|
||||
**Swarm (0.2)**是一个Docker集群工具,将一个Docker主机池转换为一个虚拟主机。在新特性里,容器甚至被放在了可用的节点上。通过添加更多的Docker命令,所有的努力都朝着支持完整的Docker API。将来,使用第三方驱动来集群会成为可能。
|
||||
|
||||
**Compose (1.2)** 是一个Docker里定义和运行复杂应用的工具, 也得到了升级。在新版本里,一个可以创建多个子文件,而不是一个没有结构的文件描述一个多容器应用。
|
||||
|
||||
通过**Machine (0.2)**,我们可以很容易地在本地计算机,云和数据中心上搭建Docker主机。新的发行版为开发者提供了一个相对干净地驱动界面来写驱动。供应被Machine牢牢地掌握,而不是每个独立的驱动。新的命令被添加,可以用来生成主机的TLS证书,以提高安全性。
|
||||
|
||||
### 在Fedora / CentOS 上升级架构 ###
|
||||
|
||||
在这一部分里,我们将会学习如何在Fedora和CentOS上升级已有的docker到最新版本。请注意,目前的Docker仅运行在64位的架构上,Fedora和CentOS都源于RedHat,命令的使用是差不多相同的,除了在Fedora20和CentOS6.5里Docker包被叫做“docker-io”。
|
||||
|
||||
如果你系统之前没有安装Docker,使用下面命令安装:
|
||||
|
||||
"yum install docker-io" – on Fedora20 / CentOS6.5
|
||||
|
||||
"yum install docker" - on Fedora21 / CentOS7
|
||||
|
||||
在升级之前,备份一下docker镜像和容器卷是个不错的主意。
|
||||
|
||||
参考[filesystem to a tar archive][1]与[volumes backups, restores or migrations options][2],获取更多信息。
|
||||
|
||||
目前,测试系统安装了Docker1.5。样例输出显示是来自一个Fedora20的系统。
|
||||
|
||||
验证当前系统安装的Docker版本
|
||||
|
||||
[root@TestNode1 ~]#sudo docker -v
|
||||
|
||||
Docker version 1.5.0, build a8a31ef/1.5.0
|
||||
|
||||
如果Docker正在运行,先停掉。
|
||||
|
||||
[root@TestNode1 ~]# sudo systemctl stop docker
|
||||
|
||||
升级到最新版使用yum update。但是写这篇文章的时候,仓库并不是最新版本(1.6)。因此你需要使用二进制的升级方法。
|
||||
|
||||
[root@TestNode1 ~]#sudo yum -y update docker-io
|
||||
|
||||
No packages marked for update
|
||||
|
||||
[root@TestNode1 ~]#sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker
|
||||
|
||||
--2015-04-19 13:40:48-- https://get.docker.com/builds/Linux/x86_64/docker-latest
|
||||
|
||||
Resolving get.docker.com (get.docker.com)... 162.242.195.82
|
||||
|
||||
Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected.
|
||||
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
|
||||
Length: 15443598 (15M) [binary/octet-stream]
|
||||
|
||||
Saving to: /usr/bin/docker
|
||||
|
||||
100%[======================================>] 15,443,598 8.72MB/s in 1.7s
|
||||
|
||||
2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved
|
||||
|
||||
检查更新版本
|
||||
|
||||
[root@TestNode1 ~]#sudo docker -v
|
||||
|
||||
Docker version 1.6.0, build 4749651
|
||||
|
||||
重启docker服务
|
||||
|
||||
[root@TestNode1 ~]# sudo systemctl start docker
|
||||
|
||||
确认Docker在运行
|
||||
|
||||
[root@TestNode1 ~]# docker images
|
||||
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
|
||||
fedora latest 834629358fe2 3 months ago 241.3 MB
|
||||
|
||||
[root@TestNode1 ~]# docker run fedora /bin/echo Hello World
|
||||
|
||||
Hello World
|
||||
|
||||
CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图启动Docker服务的时候,你可能会得到错误的信息,如下所示
|
||||
|
||||
docker.service - Docker Application Container Engine
|
||||
|
||||
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
|
||||
|
||||
Active: failed (Result: exit-code) since Mon 2015-04-20 03:24:24 EDT; 6h ago
|
||||
|
||||
Docs: http://docs.docker.com
|
||||
|
||||
Process: 21069 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127)
|
||||
|
||||
Main PID: 21069 (code=exited, status=127)
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Starting Docker Application Container E.....
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)"
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)"
|
||||
|
||||
Apr 20 03:24:24 centos7 docker[21069]: /usr/bin/docker: relocation error: /...ce
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: docker.service: main process exited, co.../a
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Failed to start Docker Application Cont...e.
|
||||
|
||||
Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state.
|
||||
|
||||
这是一个熟知的bug([https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3]),需要一个设备映射的升级,到最新的水平。
|
||||
|
||||
[root@centos7 ~]# rpm -qa device-mapper
|
||||
|
||||
device-mapper-1.02.84-14.el7.x86_64
|
||||
|
||||
[root@centos7 ~]# yum update device-mapper
|
||||
|
||||
[root@centos7 ~]# rpm -qa device-mapper
|
||||
|
||||
device-mapper-1.02.93-3.el7.x86_64
|
||||
|
||||
[root@centos7 ~]# systemctl start docker
|
||||
|
||||
### 总结 ###
|
||||
|
||||
尽管docker技术出现时间不长,当很快获得了流行。它使得开发者的生活变得容易,运维团队可以快速独立地创建和部署应用。通过公司发布快速的Docker更新,来提升产品质量,满足用户需求,未来对于Docker来说一片光明。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://docs.docker.com/reference/commandline/cli/#export
|
||||
[2]:http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes
|
||||
[3]:https://bugzilla.redhat.com/show_bug.cgi?id=1207839
|
||||
[4]:
|
||||
[5]:
|
||||
[6]:
|
||||
[7]:
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
Loading…
Reference in New Issue
Block a user