I am using following command to build the image:
$TOKEN = $(az acr login --name acr11908e1dv01.azurecr.io --expose-token --output tsv --query accessToken)
docker login acr11908e1dv01.azurecr.io -u 00000000-0000-0000-0000-000000000000 -p $TOKEN
cd ./Docker
docker image build --build-arg AUSER=$(AUSER) --build-arg APASS=$(APASS) --file Dockerfile . -t acr11908e1dv01.azurecr.io/docker-linux-agent:$(Build.BuildNumber)
if (("$(Build.SourceBranch)". ToLower(). Contains("master")) -or ("$(Build.SourceBranch)". ToLower(). Contains("develop")))
{
docker push acr11908e1dv01.azurecr.io/docker-linux-agent:$(Build.BuildNumber)
}
docker logout
amd then I am trying to use following command to check the size of the image which was developed using above command
IMAGE_NAME=“acr11908e1dv01.azurecr.io/docker-linux-agent:$(Build.BuildNumber)”
TAG=“$(Build.BuildNumber)”
SIZE=$(docker images --format “{{. Size}}” ${IMAGE_NAME}😒{TAG})
echo “The size of the image ${IMAGE_NAME}😒{TAG} after build is ${SIZE}.”
But i am not fetching ant size. Please suggest how we can fetch size of the image in my case?