源代码编写翻译,Docker源码编写翻译

法定建议docker源码编写翻译在docker容器内开展,因为官方提供的容器内已经持续了编译须要的条件,如若非要本身搭建编写翻译景况也不是不可能,正是有点某个麻烦。以下以壹.八.二本子为例。

合法建议docker源码编写翻译在docker容器内开始展览,因为官方提供的容器内壹度三番七回了编写翻译必要的情状,假如非要本人搭建编写翻译境况也不是无法,正是有点有点麻烦。以下以壹.8.二本子为例。

编写翻译docker的须求条件

  那阵子在商家搞docker
container那么些才干,docker编写翻译英特网查了须臾间木有可相信的。只可以自个儿出手丰衣足食了。

  注解:你编写翻译docker不需求git
pull它的源码,必备条件唯有二个,正是你有壹台能pull镜像的docker主机就行了。

自家情形是VMware下CentOS Linux release 柒.一.1503 [x86_64]

以下为编写翻译进度的切切实实记录

官方提议Docker源码编写翻译在Docker容器内进行,因为官方提供的器皿内早已再而三了编译供给的条件,假设非要本身搭建编写翻译处境也不是不能,正是有些有个别麻烦。以下以1.8.二版本为例。

1.pull docker-dev:1.8.2的镜像

docker pull docker-dev:版本

源代码编写翻译,Docker源码编写翻译。实际版本能够查阅官方网址。
ps:该镜像十分的大,能够思考从国内镜像下载。

1.pull docker-dev:1.8.2的镜像

docker pull docker-dev:版本

具体版本能够查阅官方网站。
ps:该镜像一点都不小,能够设想从境内镜像下载。

1.pull docker-dev:1.8.2的镜像

[root@myserv docker]# docker pull docker-dev:1.8.2Pulling repository docker-devab03141ac2e9: Pulling dependent layersd3a1f33e8a5a: Download completec22013c84729: Download completed74508fb6632: Download complete91e54dfb1179: Download complete758970a22420: Download complete62fd5b9e4d35: Download complete944fcdea21b1: Download completeab975b7812f0: Download complete0f860819eb9c: Download completeadcf22790962: Download completec79325ee5872: Download complete115d2806e84a: Download complete1705282a2f45: Download complete5d8bf41b5802: Download complete3388f79cde5c: Download complete979009c412cd: Download complete11eaa2b57f9e: Download completeb3ff0a3e16f1: Download completea7cc3d81aeed: Download complete94b8248ce242: Download complete006aa3cb8d92: Download complete5ce85bb004d1: Download complete28907ad32b10: Download complete919096bcd935: Download complete2a138d63ee40: Download complete2b2733893e80: Download completeab03141ac2e9: Download complete906727032fc8: Download completec296523a5eea: Download completef38d4f3bc631: Download completeb5564cf04aab: Download completecd3a9bdbad49: Download completea223a267d4b0: Download complete0912427504fa: Download complete9d153769f49b: Download complete4ec1b8c4c270: Download complete7ca719ee5f14: Download complete3b994c4a49de: Download complete062d730e6007: Download completeac1892714a82: Download completeac43d240b0a2: Download completedbab3fbdd774: Download complete79d657b6d894: Download complete725fa96f33ab: Download completead50f4526814: Download completeee0aa2630de6: Download completea9314782dbbf: Download complete23f7502170cd: Download complete8bfc29dd7728: Download completeStatus: Downloaded newer image for docker-dev:1.8.2

1.pull docker-dev:1.8.2的镜像

docker pull docker-dev:版本

具体版本能够查看官方网站。
ps:该镜像相当大,能够设想从国内镜像下载。

二.开立目录存放docker编译后生成的文件夹

[root@myserv home]# mkdir -p /home/dockerbuild/bundles
[root@myserv home]# cd /home/dockerbuild/

二.开立目录存放docker编写翻译后变化的文件夹

[root@myserv home]# mkdir -p /home/dockerbuild/bundles
[root@myserv home]# cd /home/dockerbuild/

二.创设二个索引存放docker编写翻译后变化的文件夹

[root@myserv home]# mkdir -p /home/dockerbuild/bundles[root@myserv home]# cd /home/dockerbuild/

二.创办目录存放docker编写翻译后变化的文件夹

[root@myserv home]# mkdir -p /home/dockerbuild/bundles
[root@myserv home]# cd /home/dockerbuild/

三.周转pull获得的docker-dev镜像,然后在容器里打开docker的编写翻译工作

[root@myserv home]# docker run --rm -it --privileged \
  -e BUILDFLAGS -e DOCKER_CLIENTONLY -e DOCKER_EXECDRIVER -e DOCKER_EXPERIMENTAL \
  -e DOCKER_GRAPHDRIVER -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TESTDIRS -e TESTFLAGS -e TIMEOUT \
  -v /home/dockerbuild/bundles:/go/src/github.com/docker/docker/bundles docker-dev:1.8.2 bash

root@87193e358c88:/go/src/github.com/docker/docker# hack/make.sh binary

---> Making bundle: binary (in bundles/1.8.2/binary)
Building: bundles/1.8.2/binary/docker-1.8.2
Created binary: bundles/1.8.2/binary/docker-1.8.2

3.周转pull获得的docker-dev镜像,然后在容器里进行docker的编写翻译工作

[root@myserv home]# docker run --rm -it --privileged \
  -e BUILDFLAGS -e DOCKER_CLIENTONLY -e DOCKER_EXECDRIVER -e DOCKER_EXPERIMENTAL \
  -e DOCKER_GRAPHDRIVER -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TESTDIRS -e TESTFLAGS -e TIMEOUT \
  -v /home/dockerbuild/bundles:/go/src/github.com/docker/docker/bundles docker-dev:1.8.2 bash

root@87193e358c88:/go/src/github.com/docker/docker# hack/make.sh binary

---> Making bundle: binary (in bundles/1.8.2/binary)
Building: bundles/1.8.2/binary/docker-1.8.2
Created binary: bundles/1.8.2/binary/docker-1.8.2

三.运维刚刚pull好的docker-dev镜像,然后在容器里展开docker的编译工作

[root@myserv home]# docker run --rm -it --privileged \  -e BUILDFLAGS -e DOCKER_CLIENTONLY -e DOCKER_EXECDRIVER -e DOCKER_EXPERIMENTAL \  -e DOCKER_GRAPHDRIVER -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TESTDIRS -e TESTFLAGS -e TIMEOUT \  -v /home/dockerbuild/bundles:/go/src/github.com/docker/docker/bundles docker-dev:1.8.2 bash  root@87193e358c88:/go/src/github.com/docker/docker# hack/make.sh binary---> Making bundle: binary (in bundles/1.8.2/binary)Building: bundles/1.8.2/binary/docker-1.8.2Created binary: bundles/1.8.2/binary/docker-1.8.2

三.运营pull得到的docker-dev镜像,然后在容器里进行docker的编写翻译专门的工作

[root@myserv home]# docker run --rm -it --privileged \
  -e BUILDFLAGS -e DOCKER_CLIENTONLY -e DOCKER_EXECDRIVER -e DOCKER_EXPERIMENTAL \
  -e DOCKER_GRAPHDRIVER -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TESTDIRS -e TESTFLAGS -e TIMEOUT \
  -v /home/dockerbuild/bundles:/go/src/github.com/docker/docker/bundles docker-dev:1.8.2 bash

root@87193e358c88:/go/src/github.com/docker/docker# hack/make.sh binary

---> Making bundle: binary (in bundles/1.8.2/binary)
Building: bundles/1.8.2/binary/docker-1.8.2
Created binary: bundles/1.8.2/binary/docker-1.8.2

4.查看编写翻译输出并证实编译结果

root@87193e358c88:/go/src/github.com/docker/docker# ls -l bundles/1.8.2/binary/
total 21104
lrwxrwxrwx 1 root root   12 Sep 15 10:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 10:20 docker-1.8.2
-rw-r--r-- 1 root root   47 Sep 15 10:20 docker-1.8.2.md5
-rw-r--r-- 1 root root   79 Sep 15 10:20 docker-1.8.2.sha256

  上述能够看到在容器内,bundles目录已经有了编写翻译好的docker程序文件了。退出容器后,在本机/home/dockerbuild/bundles/一.八.2/binary目录下会得到3个编写翻译落成的docker。 

[root@myserv dockerbuild]# cd bundles/
[root@myserv bundles]# ls
1.8.2  latest
[root@myserv bundles]# cd 1.8.2/
[root@myserv 1.8.2]# ls
binary
[root@myserv binary]# ls -l
total 21104
lrwxrwxrwx 1 root root       12 Sep 15 18:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 18:20 docker-1.8.2
-rw-r--r-- 1 root root       47 Sep 15 18:20 docker-1.8.2.md5
-rw-r--r-- 1 root root       79 Sep 15 18:20 docker-1.8.2.sha256
[root@myserv binary]# ./docker version
Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Tue Sep 15 10:20:40 UTC 2015
 OS/Arch:      linux/amd64
Error response from daemon: client and server don't have same version (client API version: 1.20, server API version: 1.19)

四.查看编译输出并证实编写翻译结果

root@87193e358c88:/go/src/github.com/docker/docker# ls -l bundles/1.8.2/binary/
total 21104
lrwxrwxrwx 1 root root   12 Sep 15 10:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 10:20 docker-1.8.2
-rw-r--r-- 1 root root   47 Sep 15 10:20 docker-1.8.2.md5
-rw-r--r-- 1 root root   79 Sep 15 10:20 docker-1.8.2.sha256

  上述能够见见在容器内,bundles目录已经有了编写翻译好的docker程序文件了。退出容器后,在本机/home/dockerbuild/bundles/1.八.2/binary目录下会赢得一个编译落成的docker。 

[root@myserv dockerbuild]# cd bundles/
[root@myserv bundles]# ls
1.8.2  latest
[root@myserv bundles]# cd 1.8.2/
[root@myserv 1.8.2]# ls
binary
[root@myserv binary]# ls -l
total 21104
lrwxrwxrwx 1 root root       12 Sep 15 18:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 18:20 docker-1.8.2
-rw-r--r-- 1 root root       47 Sep 15 18:20 docker-1.8.2.md5
-rw-r--r-- 1 root root       79 Sep 15 18:20 docker-1.8.2.sha256
[root@myserv binary]# ./docker version
Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Tue Sep 15 10:20:40 UTC 2015
 OS/Arch:      linux/amd64
Error response from daemon: client and server don't have same version (client API version: 1.20, server API version: 1.19)

肆.查看编译输出并证实编译结果

root@87193e358c88:/go/src/github.com/docker/docker# ls -l bundles/1.8.2/binary/total 21104lrwxrwxrwx 1 root root       12 Sep 15 10:20 docker -> docker-1.8.2-rwxr-xr-x 1 root root 21599668 Sep 15 10:20 docker-1.8.2-rw-r--r-- 1 root root       47 Sep 15 10:20 docker-1.8.2.md5-rw-r--r-- 1 root root       79 Sep 15 10:20 docker-1.8.2.sha256

  上述能够看看在容器内,bundles目录已经有了编写翻译好的docker程序文件了。退出容器后,在本机/home/dockerbuild/bundles/1.八.2/binary目录下会博得五个编写翻译完成的docker。

[root@myserv dockerbuild]# cd bundles/[root@myserv bundles]# ls1.8.2  latest[root@myserv bundles]# cd 1.8.2/[root@myserv 1.8.2]# lsbinary[root@myserv binary]# ls -ltotal 21104lrwxrwxrwx 1 root root       12 Sep 15 18:20 docker -> docker-1.8.2-rwxr-xr-x 1 root root 21599668 Sep 15 18:20 docker-1.8.2-rw-r--r-- 1 root root       47 Sep 15 18:20 docker-1.8.2.md5-rw-r--r-- 1 root root       79 Sep 15 18:20 docker-1.8.2.sha256[root@myserv binary]# ./docker versionClient: Version:      1.8.2 API version:  1.20 Go version:   go1.4.2 Git commit:   0a8c2e3 Built:        Tue Sep 15 10:20:40 UTC 2015 OS/Arch:      linux/amd64Error response from daemon: client and server don't have same version (client API version: 1.20, server API version: 1.19)

肆.查看编写翻译输出并表明编写翻译结果

root@87193e358c88:/go/src/github.com/docker/docker# ls -l bundles/1.8.2/binary/
total 21104
lrwxrwxrwx 1 root root   12 Sep 15 10:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 10:20 docker-1.8.2
-rw-r--r-- 1 root root   47 Sep 15 10:20 docker-1.8.2.md5
-rw-r--r-- 1 root root   79 Sep 15 10:20 docker-1.8.2.sha256

  上述可以看看在容器内,bundles目录已经有了编写翻译好的docker程序文件了。退出容器后,在本机/home/dockerbuild/bundles/一.捌.2/binary目录下会获得1个编写翻译达成的docker。 

[root@myserv dockerbuild]# cd bundles/
[root@myserv bundles]# ls
1.8.2  latest
[root@myserv bundles]# cd 1.8.2/
[root@myserv 1.8.2]# ls
binary
[root@myserv binary]# ls -l
total 21104
lrwxrwxrwx 1 root root       12 Sep 15 18:20 docker -> docker-1.8.2
-rwxr-xr-x 1 root root 21599668 Sep 15 18:20 docker-1.8.2
-rw-r--r-- 1 root root       47 Sep 15 18:20 docker-1.8.2.md5
-rw-r--r-- 1 root root       79 Sep 15 18:20 docker-1.8.2.sha256
[root@myserv binary]# ./docker version
Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Tue Sep 15 10:20:40 UTC 2015
 OS/Arch:      linux/amd64
Error response from daemon: client and server don't have same version (client API version: 1.20, server API version: 1.19)

更加多Docker相关教程见以下内容

Docker安装应用(CentOS
6.5_x64)
http://www.linuxidc.com/Linux/2014-07/104595.htm

Ubuntu 14.04安装Docker 
http://www.linuxidc.com/linux/2014-08/105656.htm

Ubuntu使用VNC运维基于Docker的桌面系统 
http://www.linuxidc.com/Linux/2015-08/121170.htm

Ali云CentOS 6.五 模板上设置 Docker
http://www.linuxidc.com/Linux/2014-11/109107.htm

Ubuntu 15.04下安装Docker 
http://www.linuxidc.com/Linux/2015-07/120444.htm

在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
http://www.linuxidc.com/Linux/2014-10/108184.htm

在 Ubuntu 15.0四 上什么设置Docker及骨干用法
http://www.linuxidc.com/Linux/2015-09/122885.htm

Ubuntu 1陆.0肆上Docker使用手记
http://www.linuxidc.com/Linux/2016-12/138490.htm

Docker
的详尽介绍
:请点那里
Docker
的下载地址
:请点那里

本文永世更新链接地址:http://www.linuxidc.com/Linux/2017-03/141590.htm

澳门葡京备用网址 1

题外话

  官方之所以选拔在容器内编写翻译docker的方法是因为容器内部已经济协作龙好编写翻译docker所需的境况及零件了,小编也懒得在centos里将依附三个个装了。

Update 1

澳门葡京备用网址 ,  容器内的源码目录:/go/src/github.com/docker/docker
  其相应的GOPATH设置如下:

root@bd341b3fe6b9:/go/src/github.com/docker/docker# go envGOARCH="amd64"GOBIN=""GOCHAR="6"GOEXE=""GOHOSTARCH="amd64"GOHOSTOS="linux"GOOS="linux"GOPATH="/go:/go/src/github.com/docker/docker/vendor"GORACE=""GOROOT="/usr/local/go"GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"CC="gcc"GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"CXX="g++"CGO_ENABLED="1"

本文到此截至,多谢。

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website