编译Docker源码问题


我在尝试从源码编译Docker,看了这篇文章(https://github.com/dockercn/do ... docker)的第三种方法,但在执行这条指令RUN gopm bin -v code.google.com/p/go.tools/cmd/cover的时候报错:


The command returned a non-zero code: 1。
不知道怎么解决。本人菜鸟刚接触Docker和Go,希望能得到指点!多谢!还有如果编译成功,每次编译的时候都要根据源码中的Dockerfile穿越重重“网络阻力”下载包吗?单位不能连接外网,有没有更好的可以在无网情况下编译Docker的?
已邀请:

xds2000 - 数人科技CTO

赞同来自: 单子


经过本地环境验证,code.google.com/p/go.tools/cmd/cover 已经更新地址为 golang.org/x/tools/cmd/cover。请替换后在编译就可以通过了。

xds2000 - 数人科技CTO

赞同来自: Casgy


首先,能想到用源码编译Docker执行文件的爱好者,一定不是“菜鸟”,最多是个新手。你想做的事情就是按照网上的文章提示做一遍,体验一下过程。出问题的原因是文章中Dockfile过期了,肯定需要修正才可以解决问题。

第二,出错信息给的不全,这样反而成了解题者的帮忙的障碍,下次请把出错的步骤和完整的出错信息给出来。比如:

<pre>---> Running in 26b50a9e2a2d
14-12-10 15:34:09 App Version: 0.8.5.1125 Beta
14-12-10 15:34:09 Local repository path: /root/.gopm/repos
14-12-10 15:34:09 Indicated GOPATH: /go
14-12-10 15:34:09 Downloading package: code.google.com/p/go.tools/cmd/cover@branch:<UTD>
14-12-10 15:34:13 Linking code.google.com/p/go.tools...
14-12-10 15:34:13 Downloading package: golang.org/x/tools@branch:<UTD>
14-12-10 15:34:20 Linking golang.org/x/tools...
14-12-10 15:34:20 Getting imports: no buildable Go source files in /tmp/488871922/src/golang.org/x/tools
14-12-10 15:34:20 Got golang.org/x/tools@branch:<UTD>
14-12-10 15:34:20 Got code.google.com/p/go.tools/cmd/cover@branch:<UTD>
14-12-10 15:34:20 Linking code.google.com/p/go.tools...
14-12-10 15:34:20 Loading dependencies...
14-12-10 15:34:20 Linking golang.org/x/tools...
14-12-10 15:34:20 Getting imports: no buildable Go source files in /.vendor/src/golang.org/x/tools
14-12-10 15:34:20 Installing...
14-12-10 15:34:20 Setting GOPATH to /.vendor
14-12-10 15:34:20 ===== application outputs start =====

golang.org/x/tools/cover
code.google.com/p/go.tools/cmd/cover
14-12-10 15:34:20 ====== application outputs end ======
14-12-10 15:34:20 Setting GOPATH back to /go:/go/src/github.com/docker/docker/vendor
14-12-10 15:34:20 Previous steps weren't successful or the project does not contain main package
2014/12/26 12:43:40 The command returned a non-zero code: 1
make: *** Error 1</pre>

要回复问题请先登录注册