-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Docker | ||
# Build and push an image to Azure Container Registry | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker | ||
|
||
trigger: | ||
- master | ||
|
||
resources: | ||
- repo: self | ||
|
||
variables: | ||
# Container registry service connection established during pipeline creation | ||
dockerRegistryServiceConnection: 'd676875f-d1fb-485a-8da4-88d6bfb04604' | ||
imageRepository: 'mypythondockerrepo' | ||
containerRegistry: 'myacrrep31.azurecr.io' | ||
dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' | ||
tag: '$(Build.BuildId)' | ||
|
||
vmImageName: 'ubuntu-latest' | ||
|
||
stages: | ||
- stage: Build | ||
displayName: Build and push stage | ||
jobs: | ||
- job: Build | ||
displayName: Build | ||
pool: | ||
vmImage: $(vmImageName) | ||
steps: | ||
- task: Docker@2 | ||
displayName: Build and push an image to container registry | ||
inputs: | ||
command: buildAndPush | ||
repository: $(imageRepository) | ||
dockerfile: $(dockerfilePath) | ||
containerRegistry: $(dockerRegistryServiceConnection) | ||
tags: | | ||
$(tag) |