从Ubuntu 12.04上的源代码构建docker 0.7.2

时间:2014-01-02 15:43:08

标签: ubuntu docker

我正在尝试从源代码构建docker。我在这里从github.com帐户下载了最新版本:

https://github.com/dotcloud/docker/archive/v0.7.2.tar.gz

更改了一行代码,使Ctrl-p Ctrl-q成为Ctrl-^ Ctrl-q

diff utils/utils.go utils/utils.go~
483,484c483,484
<           // char 16 is C-p -- avilella char 30 is C-^
<           if nr == 1 && buf[0] == 30 {
---
>           // char 16 is C-p
>           if nr == 1 && buf[0] == 16 {

使用sudo make编译:

它似乎正在安装大量不同的ubuntu软件包,我不介意,只需要一段时间来下载和配置它们。

最后,我收到了这个错误:

docker run -rm -i -t -privileged -e TESTFLAGS -v /home/avilella/src/docker-0.7.2/bundles:/go/src/github.com/dotcloud/docker/bundles docker hack/make.sh binary


error: .git directory missing and DOCKER_GITCOMMIT not specified
  Please either build with the .git directory accessible, or specify the
  exact (--short) commit hash you are building using DOCKER_GITCOMMIT for
  future accountability in diagnosing build issues.  Thanks!
make: *** [binary] Error 1

这是安装此修改版docker的正确方法吗?我从apt-get安装的那个是0.7.1但是我想在我的副本中修改那行代码。

编辑:

我按照devenvironment的说明操作,并在运行sudo make build时收到此错误。

[...]
 ---> fc087a0b8a35
Step 6 : RUN cd /usr/local/lvm2 && ./configure --enable-static_link && make device-mapper && make install_device-mapper
 ---> Running in f9b5130a3c33
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnu
/bin/sed

[...]

checking whether to include support for GFS pool metadata... internal
checking whether to include support for cluster locking... internal
checking whether to include snapshots... internal
checking whether to include mirrors... internal
checking whether to include raid... internal
checking whether to include replicators... none
checking whether to include thin provisioning... none
maybe

no
none
no
no
-O2
no
no
no
yes
no
no
no
no
no
no
pkg-config initialized
2014/01/02 18:03:44 unexpected EOF
make: *** [build] Error 1

之后我重新做了sudo make build,然后就行了。然后我跟着sudo make binary跟着下一步,它运作良好。

1 个答案:

答案 0 :(得分:2)

如果您有兴趣帮助Docker开发,您需要查看我们文档中的“设置开发环境”页面:http://docs.docker.io/en/latest/contributing/devenvironment/

您还需要查看我们的“贡献”文档:https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md