Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在centos中哪里可以找到docker rpm的源代码?_Centos_Rhel - Fatal编程技术网

在centos中哪里可以找到docker rpm的源代码?

在centos中哪里可以找到docker rpm的源代码?,centos,rhel,Centos,Rhel,我用的是centos7,docker RPM的verison是 [root@node-6~]#rpm-qa | grep docker docker-common-1.13.1-63.git94f4240.el7.centos.x86_64 docker-client-1.13.1-63.git94f4240.el7.centos.x86_64 docker-1.13.1-63.git94f4240.el7.centos.x86_64 我从github下载了docker 1.13的源代码,发现它

我用的是centos7,docker RPM的verison是

[root@node-6~]#rpm-qa | grep docker

docker-common-1.13.1-63.git94f4240.el7.centos.x86_64

docker-client-1.13.1-63.git94f4240.el7.centos.x86_64

docker-1.13.1-63.git94f4240.el7.centos.x86_64

我从github下载了docker 1.13的源代码,发现它与服务器上打印的日志不匹配。RHEL/CENT OS似乎对其提供的docker进行了大量修改。我在谷歌和谷歌上搜索了很多,但没有找到运气


“centos版”docker开源吗?如果是,在哪里可以找到源代码?

默认情况下,Docker由CentOS extras存储库提供。下面是一些您可能需要考虑的命令:

# To search everything 'docker' related
yum search docker

# Once found interesting package...
yum info docker
在普通实例(即没有导入任何无关/第三方存储库)上,输出应类似于以下内容

Available Packages
Name        : docker
Arch        : x86_64
Epoch       : 2
Version     : 1.13.1
Release     : 96.gitb2f74b2.el7.centos
Size        : 18 M
Repo        : extras/7/x86_64
Summary     : Automates deployment of containerized applications
URL         : https://github.com/docker/docker
License     : ASL 2.0
Description : Docker is an open-source engine that automates the deployment of any
            : application as a lightweight, portable, self-sufficient container that will
            : run virtually anywhere.
            : 
            : Docker containers can encapsulate any payload, and will run consistently on
            : and between virtually any server. The same container that a developer builds
            : and tests on a laptop will run at scale, in production*, on VMs, bare-metal
            : servers, OpenStack clusters, public instances, or combinations of the above.
然后,为了获取(大多数情况下)特定rpm的源程序包,请尝试以下命令(假设您以前安装过yum-utils)

# Disable all repos, enable the one we have eyes on, set 'source only' and download
yumdownloader --disablerepo=\* --enablerepo=extras --source docker
这是命令的输出

Initializing download: http://vault.centos.org/centos/7/extras/Source/SPackages/docker-1.13.1-96.gitb2f74b2.el7.centos.src.rpm
File size: 14604391 bytes
Opening output file ./docker-1.13.1-96.gitb2f74b2.el7.centos.src.rpm
Starting download

Connection 2 finished                                                          ] 41% [============================-                                         ]  0.0 B/s | 5.8 MB  --:--:-- ETA 
Connection 4 finished                                                          ]
Connection 0 finished                                                          ]
Connection 1 finished                                                          ]
[100%] [..................................................] [  14.6MB/s] [00:00]100% [======================================================================] 8.1 MB/s |  14 MB  00:00:00 ETA 

Downloaded 13.9 megabytes in 0 seconds. (14921.07 KB/s)
docker-1.13.1-96.gitb2f74b2.el7.centos.src.rpm                                                                                                                         |  14 MB  00:00:01     

下载文件后,您可以将其解压缩或使用rpm安装以访问内容。Midnight Commander还可以将大多数rpm归档文件列出/查看/复制/解压缩到您选择的目录中

rpm -Uvh docker-1.13.1-96.gitb2f74b2.el7.centos.src.rpm
Updating / installing...
   1:docker-2:1.13.1-96.gitb2f74b2.el7################################# [100%]
这些文件应该安装在$HOME/rpmbuild中 SPECS文件夹将包含specfiles,SOURCES将包含为创建所述包而编译的源代码

在本例中,源代码文件位于$HOME/rpmbuild/SOURCES/b2f74b220126bddbae585cfe2406498ced3ae065.tar.gz中


用于创建rpm包的specfile也是一个有趣的文件。在该文件中,您将了解到对包维护者或发行版“专有”的特殊内容/编译前/编译后的修改。

使用
yum search docker
yum install docker
。我发现最好使用可用的软件通过
yum
而不是构建您自己的。请参阅OldFart的帖子…docker Repository很抱歉您的答案被延迟接受。您详细的答案确实帮了大忙,非常感谢。