cod*_*lue 6 docker dockerfile azure-devops azure-pipelines-build-task azure-pipelines
我们正在尝试使用 Azure Pipelines 为 Dot Net Core 应用程序构建 Docker 映像。设置管道时,如果我选中“默认构建上下文”,它会自动从我的根目录中选择 Dockerfile 吗?
Dockerfile 当前位于根目录中,但我想将 Dockerfile 移动到 api 项目中。如何设置管道以便从根目录执行 docker build 命令,但引用项目内的 Dockerfile?
我没有试过这个,但这样的事情应该有效:
- task: Docker@1
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: my_service_connection
imageName: bla-bla-bla
dockerFile: src/app/dockerfile
buildContext: $(Build.Repository.LocalPath)
Run Code Online (Sandbox Code Playgroud)
该任务的第 2 版支持设置构建上下文:
| 归档时间: |
|
| 查看次数: |
3970 次 |
| 最近记录: |