Skip to content

Instantly share code, notes, and snippets.

@michalpenka
Last active March 18, 2020 14:07
Show Gist options
  • Save michalpenka/b11d1333f82ec4d45cab6de3a0b69616 to your computer and use it in GitHub Desktop.
Save michalpenka/b11d1333f82ec4d45cab6de3a0b69616 to your computer and use it in GitHub Desktop.
Azure DevOps build pipeline
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
variables:
tagBuild: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
displayName: Build and push the image
inputs:
containerRegistry: 'Docker Hub'
repository: 'YOUR_DOCKERHUBID/YOUR_DOCKERHUBREPONAME'
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: |
$(tagBuild)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment