skip to Main Content

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


  1. 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.

    (InaccessibleImage) The image ‘vivek.azurecr.io/caddy:latest’ in container group ‘container21aug’ is not accessible. Please check the image and registry credential.

    Code: InaccessibleImage

    Message: The image ‘vivek.azurecr.io/caddy:latest’ in container group ‘container21aug’ is not accessible. Please check the image and registry credential.

    I followed this steps:

    • I pushed Image ACR

    Enable Admin user in Azure container registry

    Below given command which worked for me.

    I am using caddy image and enabled Ip address to check the caddy default page.

    az container create --resource-group Vivek-RG --name container21aug --image vivek.azurecr.io/caddy:latest --registry-password xxxxxxxxxxxxxxxxx --ip-address Public
    

    OUTPUT:

    Login or Signup to reply.
  2. The error you encountered is clearly stated to check your:

    1. Image
    2. Registry credentials.
      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:

    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)'"
    

    Alternatively, pull the image locally using docker.

    docker pull owasp/zap2docker-stable
    

    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:

    az container create --resource-group <your-resource-group> --name <your-container-name> 
        --image nginx --ports 80
    

    or

    az container create --resource-group $(zapACIGroupName) --name $(zapACIName) 
        --image hello-world --ports 80
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search