I am using following commands: but it is failing with following image. how to fix this?
az container create --resource-group $(zapACIGroupName) --name $(zapACIName)
--image owasp/zap2docker-stable --ports 8080 8090
--azure-file-volume-account-name $(zapACIStoreName)
--azure-file-volume-account-key $(createSA.aciStoreKey)
--azure-file-volume-share-name $(zapACIShareName)
--azure-file-volume-mount-path /zap/wrk/
--command-line "/bin/bash -c 'zap-baseline.py -t https://$(webAppNameDev).azurewebsites.net -x $(zapReportName)'"
But I am seeing following error:
ERROR: (InaccessibleImage) The image ‘owasp/zap2docker-weekly:latest’ in container group ‘ausemart-zap01-aci’ is not accessible. Please check the image and registry credential.
Code: InaccessibleImage
Message: The image ‘owasp/zap2docker-weekly:latest’ in container group ‘ausemart-zap01-aci’ is not accessible. Please check the image and registry credential.
I have tried to use different image version but same error.
and I have tested locally same error
2
Answers
To create Container Instance using image from Azure Container Registry or any private registry. you need to enable
Admin user
and pass the username and password value.Without enabling the admin user i was also getting same error as we need to pass user name and password.
I followed this steps:
Enable Admin user in Azure container registry
Below given command which worked for me.
OUTPUT
:The error you encountered is clearly stated to check your:
It indicated that Azure Container Instances (ACI) is unable to access the Docker image owasp/zap2docker-weekly:latest. There are several reasons that can caused this not limited to image not existing, permission issues, or incorrect image name or tag.
Your code seems to be Okay. However, since this is happening on local and cloud environments there are couple of a few things you will need to check to resolve the issues.
Firstly, as listed above:
Check that image is existing:
Check you admin permission issues to the registry:
Check that you are using correct image name and tag (Avoid typo error) here: https://hub.docker.com/r/owasp/zap2docker-stable/tags
Use this command to check a stable version of the image:
Alternatively, pull the image locally using docker.
Use Azure Container Registry (ACR) and ensure your ACI can access it by configuring the proper credentials.
Also, upgrade Azure CLI using bash
az upgrade
Lastly, if the error continues to appear, try to use a different public registry or another image to see if the issue is specific to the Docker Hub image. Try to run a simpler command to isolate the issue like the from Azure CLI using bash command:
or