使用heroku.yml开发者预览版时(https://devcenter.heroku.com/articles/build-docker-images-heroku-yml)。目前是否有任何方法可以指定 docker 构建上下文以及 dockerfile?
我想模拟的命令是:
docker build -f cmd/api/Dockerfile .
Run Code Online (Sandbox Code Playgroud)
注意:
.我在这里提供了构建上下文的路径。
目前,我能够成功运行以下命令:
build:
docker:
web: cmd/api/Dockerfile
Run Code Online (Sandbox Code Playgroud)
或者,使用更明确的版本:
build:
docker:
web:
dockerfile: cmd/api/Dockerfile
Run Code Online (Sandbox Code Playgroud)
基于从多阶段构建中定位阶段的能力,我的假设是我也能够以与构建字段context相同的方式提供:docker-compose
build:
docker:
web:
dockerfile: cmd/api/Dockerfile
context: .
Run Code Online (Sandbox Code Playgroud)
但是,这会从 Heroku 返回以下错误响应:
remote: Building source:
remote: === Fetching app code
remote:
remote: =!= There were problems parsing your heroku.yml. We've detected the following issues:
remote:
remote: build.docker.web.context in body is a forbidden property
remote: Verifying deploy...
remote:
remote: ! Push rejected to docker-build-context-test.
remote:
Run Code Online (Sandbox Code Playgroud)
这是我可以实现的已知功能吗?我很可能需要发送功能请求,因为此功能是开发人员预览版,但感觉像是他们已经包含的功能。
希望大家能给一些答案!
https://devcenter.heroku.com/articles/build-docker-images-heroku-yml
Docker 构建上下文始终设置为包含 Dockerfile 的目录,并且无法单独配置。
| 归档时间: |
|
| 查看次数: |
1856 次 |
| 最近记录: |