Push Docker Image to Docker Registry using Azure Pipeline

Azure Pipeline

Docker Hub

Azure Devops

Code to Deploy

How to Do it?

# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
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: Login to Docker Hub
inputs:
command: login
containerRegistry: test
- task: Docker@2
displayName: Build and Push
inputs:
command: buildAndPush
repository: username/repository
tags: |
v1

Astrophile | Technophile | Opensource enthusiast