Skip to content

Build Docker Image #6596

Answered by kevball2
John0x asked this question in Q&A
Apr 20, 2022 · 4 comments · 7 replies
Discussion options

You must be logged in to vote

You could

param utcValue string = utcNow()

resource acrDeploy 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
  name: 'acrDeploy'
  location: resourceGroup().location
  kind: 'AzureCLI'
  properties: {
    forceUpdateTag: utcValue
    azCliVersion: '2.28.0'
    timeout: 'PT30M'
    scriptContent: 'az acr build --image sample/hello-world:v1 --registry myContainerRegistry008 --file Dockerfile .'
    cleanupPreference: 'OnSuccess'
    retentionInterval: 'P1D'
  }
}

I am not 100% if that command would wait for your docker image to build before it deployed though. Check out the DeploymentScriptsAPI for more properties you may need as well. The previous article I listed has some sample…

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@John0x
Comment options

Comment options

You must be logged in to vote
1 reply
@abossard
Comment options

Answer selected by brwilkinson
Comment options

You must be logged in to vote
5 replies
@kevball2
Comment options

@alex-frankel
Comment options

@John0x
Comment options

@alex-frankel
Comment options

@John0x
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants