Azure-devops-docs: Buildandpush ignores ARGs

Created on 7 Oct 2019  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

When you add arguments to a 'build and push' it presents a warning when the build runs, stating that it ignores arguments. Can we have an example of seperate build and push tasks that would allow you to add arguments to the build process please


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cictech devopprod doc-enhancement stale-issue

Most helpful comment

new to Azure pipelines and was misled for a long time

just for reference

steps:
  - task: Docker@2
    displayName: Build an image
    inputs:
      containerRegistry: '$(containerRegistry)'
      repository: '$(imageRepository)'
      command: 'build'
      arguments: '--build-arg app=$(app)'
      Dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
  - task: Docker@2
    displayName: Push the image
    inputs:
      containerRegistry: '$(containerRegistry)'
      repository: '$(imageRepository)'
      command: 'push'

All 4 comments

@ChrisGibson1982 -- Chris, you may find an example here:

@shashankbarsin -- Shashank, please consider adding such an example to the documentation.

"Other commands and arguments" is there, but would be nice to have the push command as well

new to Azure pipelines and was misled for a long time

just for reference

steps:
  - task: Docker@2
    displayName: Build an image
    inputs:
      containerRegistry: '$(containerRegistry)'
      repository: '$(imageRepository)'
      command: 'build'
      arguments: '--build-arg app=$(app)'
      Dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
  - task: Docker@2
    displayName: Push the image
    inputs:
      containerRegistry: '$(containerRegistry)'
      repository: '$(imageRepository)'
      command: 'push'

This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adnanebrahimi picture adnanebrahimi  Â·  3Comments

sevaa picture sevaa  Â·  3Comments

MJECloud picture MJECloud  Â·  3Comments

atrauzzi picture atrauzzi  Â·  3Comments

sandeepzgk picture sandeepzgk  Â·  3Comments