![](/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.