简体   繁体   English

无法从github存储库分支构建docker映像

[英]Can't build docker image from github repository branch

I have a private GitHub repository containing 2 branches: master and stage . 我有一个私有的GitHub存储库,其中包含2个分支: masterstage Repository contains a Dockerfile and other files necessary to build a container image. 存储库包含一个Dockerfile和其他用于构建容器映像的文件。 According to the documentation I can specify the branch when calling docker build command. 根据文档,我可以在调用docker build命令时指定分支。

However, I am able to run: 但是,我可以运行:

sudo docker build -t="superimage" https://github.com/organization/repo.git

After this I am asked for my GitHub login and password. 之后,系统要求我输入GitHub登录名和密码。

But when I try to run: 但是当我尝试运行时:

https://github.com/organization/repo.git#stage

I am getting: 我正进入(状态:

Error: Got HTTP status code >= 400: 404 Not Found

What am I doing wrong? 我究竟做错了什么?

According to the changelog ( https://github.com/docker/docker/blob/master/CHANGELOG.md#170-2015-06-16 ) the building of specific git branches appears to be a feature introduced in 1.7. 根据变更日志( https://github.com/docker/docker/blob/master/CHANGELOG.md#170-2015-06-16 ),特定git分支的构建似乎是1.7中引入的功能。 You'll need to upgrade to 1.7+ to get this functionality. 您需要升级到1.7+才能获得此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM