dongpu1315
2017-01-18 14:49
浏览 177

为golang静态二进制文件构建,部署,推送docker映像

I am looking for a solution to a simple configuration problem to solve; it has been nagging me for quite some time now. :)

I have a golang project on github which gives me a static binary, and uses godeps.

Now I want to ensure that the godep go install ... command can be run after a git clone and a docker container be built from this newly built binary locally.

As an option, the user should be able to push it to docker hub or a private repo as applicable.

I am thinking of using Makefiles, but that seems too complicated (set the gopath, then godep build, modify the Dockerfile dynamically to point to the place where the binary is located, then a docker build).

Is there an easier way to do it?

图片转代码服务由CSDN问答提供 功能建议

我正在寻找解决简单配置问题的解决方案; 现在已经困扰了我好一段时间了。 :)</ p>

我在github上有一个golang项目,该项目为我提供了一个静态二进制文件,并使用了Godeps。</ p>

现在,我要确保< 您可以在本地使用此新建二进制文件构建git clone和docker容器后运行code> godep go install ... </ code>命令。</ p>

作为一种选择,用户 应该能够将其推送到docker hub或适用的私有存储库中。</ p>

我正在考虑使用Makefile,但这似乎太复杂了(设置gopath,然后godep构建,修改 Dockerfile动态地指向二进制文件所在的位置,然后是docker构建文件。)</ p>

有没有更简单的方法?</ p> </ div>

2条回答 默认 最新

相关推荐 更多相似问题