Goal :
- Create BlackBox Exporter Image to Azure Container Registry using Azure CLI
Result
- Private Container Image rather than Public Docker Hub Image.
Script
$ResourceGroupName = "suryarg"
$LocationName = "eastus2"
$ACRName = "suryacr"
$ACRUrl = "$ACRName.azurecr.io"
#Create a resource group
az group create --name $ResourceGroupName --location $LocationName
#Create a container registry
az acr create --resource-group $ResourceGroupName --name $ACRName --sku Basic --admin-enabled true
#Log in to Azure Container Registry
az acr login --name $ACRName
#First Pull latest BlackBox Exporter Image from DockerHub
docker pull prom/blackbox-exporter:latest
#Then Push into Azure Container Registry
docker tag prom/blackbox-exporter:latest $ACRUrl/blackbox-exporter:SuryaLatest
docker push $ACRUrl/blackbox-exporter:SuryaLatest
Result
Top comments (0)