(InaccessibleImage) The image From Azure container instance

Varma 1,385 Reputation points
2024-08-20T15:19:12.49+00:00

I am using following commands: but it is failing with following image. Please suggest 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)'"

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.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
711 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Krishna Katakam 700 Reputation points Microsoft Vendor
    2024-08-21T13:53:37.12+00:00

    Hi Varma,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    The error you're encountering indicates that Azure Container Instance (ACI) is unable to access the Docker image owasp/zap2docker-stable. This issue is often related to incorrect image names or registry access problems. Here are some steps to help resolve the issue:

    Verify the Image Name and Tag: Ensure that the Docker image owasp/zap2docker-stable is correct. The error message suggests owasp/zap2docker-weekly:latest as an alternative. You can verify the correct image name and tag by visiting the OWASP ZAP Docker Hub page or by running the following command locally:

    docker pull owasp/zap2docker-stable
    

    If owasp/zap2docker-stable is not available or is incorrect, you might want to use owasp/zap2docker-weekly:latest instead:

    az container create --resource-group $(zapACIGroupName) --name $(zapACIName) --image owasp/zap2docker-weekly:latest --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)'"
    
    

    Check Registry Authentication:

    If the image is in a private registry, ensure that you provide the correct registry credentials. You can specify registry credentials using the --registry-login-server, --registry-username and --registry-password parameters:

    az container create --resource-group $(zapACIGroupName) --name $(zapACIName) --image <private-registry>/<image>:<tag> --ports 8080 8090 --registry-login-server <your-registry> --registry-username <username> --registry-password <password> --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)'"
    

    Review ACI Logs:

    To get more details about the error, you can review the logs of your ACI:

    az container logs --resource-group $(zapACIGroupName) --name $(zapACIName)
    

    Update Azure CLI:

    Make sure you're using the latest version of the Azure CLI, as this can sometimes resolve unexpected issues:

    az upgrade
    

    You can refer to the detailed troubleshooting guide on the Microsoft Learn website: DeploymentFailed - InaccessibleImage error code - Azure

    If you have any further queries, do let us know. If the comment is helpful, please click "Upvote".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.