GitHub 在 ./Dockerfile (.NET Core) 找不到 Dockerfile
GitHub Dockerfile not found at ./Dockerfile (.NET Core)
我知道网上有一些关于此的信息,但我是这项技术的新手,这些信息似乎对我的问题没有帮助。
我正在尝试触发连接到我的 GitHub 存储库的 docker 构建。
当我从 Visual Studio 将解决方案签入 master 时,我触发了 docker 构建,但失败并显示以下内容。
但是,一个潜在的问题可能是 Docker 文件存在于 Github 但不在根文件夹中。当我进入解决方案文件夹时找到该文件,这就是 Visual Studio 添加文件的方式。
这是 Docker 文件下一层的位置。
它就在这里。
我的解决方案中确实有 Docker 文件,我将其作为图像发布到 Docker Hub。
我漏掉了什么明显的东西吗?
谢谢
默认情况下,DockerHub 在项目的根目录中查找 Dockerfile
。
因为这里不是这种情况,所以您应该在 Build rules section 中指定您的 Dockerfile
的路径:
Specify the Dockerfile location as a path relative to the root of the source code repository. (If the Dockerfile is at the repository root, leave this path set to /.)
此截图显示了一些配置(这里有多个构建规则,但重点放在 Dockerfile location 列):
在您的示例中,您应该将 Dockerfile location 设置为 MyFirstContainerApp/Dockerfile
。
我知道网上有一些关于此的信息,但我是这项技术的新手,这些信息似乎对我的问题没有帮助。
我正在尝试触发连接到我的 GitHub 存储库的 docker 构建。
当我从 Visual Studio 将解决方案签入 master 时,我触发了 docker 构建,但失败并显示以下内容。
但是,一个潜在的问题可能是 Docker 文件存在于 Github 但不在根文件夹中。当我进入解决方案文件夹时找到该文件,这就是 Visual Studio 添加文件的方式。
这是 Docker 文件下一层的位置。
它就在这里。
我的解决方案中确实有 Docker 文件,我将其作为图像发布到 Docker Hub。
我漏掉了什么明显的东西吗?
谢谢
默认情况下,DockerHub 在项目的根目录中查找 Dockerfile
。
因为这里不是这种情况,所以您应该在 Build rules section 中指定您的 Dockerfile
的路径:
Specify the Dockerfile location as a path relative to the root of the source code repository. (If the Dockerfile is at the repository root, leave this path set to /.)
此截图显示了一些配置(这里有多个构建规则,但重点放在 Dockerfile location 列):
在您的示例中,您应该将 Dockerfile location 设置为 MyFirstContainerApp/Dockerfile
。