【问题标题】:Can't build docker image from github repository branch无法从 github 存储库分支构建 docker 映像
【发布时间】:2016-06-24 08:12:28
【问题描述】:

我有一个包含 2 个分支的私有 GitHub 存储库:masterstage。 存储库包含Dockerfile 和构建容器映像所需的其他文件。 根据documentation我可以在调用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

我做错了什么?

【问题讨论】:

  • 什么版本的 Docker?
  • Docker 版本 1.5.0

标签: github docker branch docker-build


【解决方案1】:

根据变更日志 (https://github.com/docker/docker/blob/master/CHANGELOG.md#170-2015-06-16),特定 git 分支的构建似乎是 1.7 中引入的功能。您需要升级到 1.7+ 才能获得此功能。

【讨论】:

    猜你喜欢
    • 2018-01-05
    • 2015-01-01
    • 2021-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多