Unable to create container instance of private Github Container Repository (ghcr) image.

Ian Spence 1 Reputation point
2021-07-28T01:18:51.85+00:00

I am trying to create an Azure Container Instance of a private image on my ghcr.io (Github Container Repository).

I generated an personal access token on my Github account which has read permissions

118328-2.png

I can use this personal access token to authenticate with the registry on my local linux box

118406-3.png

But when I try to create a container with the same parameters I get an error that the image is not accessible

118443-1.png

This is the deployment error I'm getting:

{  
  "code": "DeploymentFailed",  
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",  
  "details": [  
    {  
      "code": "InaccessibleImage",  
      "message": "The image 'ghcr.io/ecnepsnai/<OMITTED>:latest' in container group '<OMITTED>' 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.
757 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SRIJIT-BOSE-MSFT 4,346 Reputation points Microsoft Employee
    2021-07-28T11:32:41.597+00:00

    @Ian Spence , Thank you for sharing your concern here.

    As it so happens, we could not reproduce this behavior with container images, particularly hosted in ghcr.io. However, evidently in your case, the deployment did fail with code: InaccessibleImage.

    If an Azure Container Instance is initially unable to pull your image, it retries for a period of time. If the image pull operation continues to fail, ACI eventually fails the deployment, and you may see a Failed to pull image error.

    To resolve this issue, delete the container instance and retry your deployment. Ensure that the image exists in the registry, and that you've typed the image name correctly (and the registry username and password too). Also please ensure that the GitHub PAT (Private Access Token) is not expired.

    For more information on common issues with Azure Container Instances please visit Troubleshoot common issues in Azure Container Instances

    ----------

    Hope this helps.

    Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.

    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.