Skip to content

Instantly share code, notes, and snippets.

@devops-school
Last active December 21, 2023 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devops-school/0578576b6d63a027277aa1d55e86016d to your computer and use it in GitHub Desktop.
Save devops-school/0578576b6d63a027277aa1d55e86016d to your computer and use it in GitHub Desktop.
Azure Devops Pipeline YAML Example - Build a Docker image
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- main
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: build
dockerfile: '**/Dockerfile'
tags: |
$(tag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment