![](/img/trans.png)
[英]Docker: how to build an image from a non-master branch on Github repository
[英]Can't build docker image from github repository branch
我有一个私有的GitHub存储库,其中包含2个分支: master
和stage
。 存储库包含一个Dockerfile
和其他用于构建容器映像的文件。 根据文档,我可以在调用docker build命令时指定分支。
但是,我可以运行:
sudo docker build -t="superimage" https://github.com/organization/repo.git
之后,系统要求我输入GitHub登录名和密码。
但是当我尝试运行时:
https://github.com/organization/repo.git#stage
我正进入(状态:
Error: Got HTTP status code >= 400: 404 Not Found
我究竟做错了什么?
根据变更日志( https://github.com/docker/docker/blob/master/CHANGELOG.md#170-2015-06-16 ),特定git分支的构建似乎是1.7中引入的功能。 您需要升级到1.7+才能获得此功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.