Basics of running a Docker container on Azure

halpert3 26 Reputation points
2022-07-15T22:32:05.07+00:00

I'm following this tutorial:
How To Deploy Containers to Azure ACI using Docker CLI and Compose

and when I run the command:

docker --context myaci run -d --name web -p 80:80 nginx

I get the following error:

containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="MoreImageRegistryCredentialsThanContainers" Message="More image registry credentials provided than containers in container group 'web'."

If I run the command without the --name web flag, a new container group seems to be generated with a random name, and I get the same error. How can I fix this?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
610 questions
0 comments No comments
{count} votes

Accepted answer
  1. kobulloc-MSFT 22,076 Reputation points Microsoft Employee
    2022-07-16T03:39:10.273+00:00

    Hello, @halpert3 !

    Why am I running into a "MoreImageRegistryCredentialsThanContainers" error on Azure Container Instances (ACI)?
    If you run the following on ACI, you'll get an error:

    Command

    docker --context myacicontext run -p 80:80 nginx  
    

    Resulting error

    containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="MoreImageRegistryCredentialsThanContainers" Message="More image registry credentials provided than containers in container group 'mycontainergroup'."  
    

    This has been reported by lonevvolf in GitHub issue 2150 and is caused by the Docker Hub repo not residing in the default search location (Azure Container Registry). Using the full URI where the image is hosted will resolve this issue:

    docker --context myacicontext run -p 80:80 registry.hub.docker.com/library/nginx  
    

    References and additional reading:

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful