In Azure Batch, I create a Pool with “prefetch images for container configuration” according to the instructions of
https://video2.skills-academy.com/en-us/azure/batch/batch-docker-container-workloads#container-configuration-for-batch-pool
Firstly, I used an image from Azure Container Registry, it works.
Then I used an image from Docker Hub page (the repository is public), it works. Previously I uploaded the image by publishing my project in Visual Studio to Docker Hub. Setting the container registry of the Pool, I had to change the registryServer, “https://hub.docker.com” does not work for me, I changed it to “https://registry.hub.docker.com” and this works.
Then, in Docker Hub, I changed the repository from public to private, and now the Pool does not work. Now, when I start the Pool, the Node has the error
Code:ContainerInvalidImage
Message:
One or more container images specified are invalid
Values:
ContainerImage - xxx/yyy:latest
Message - pull access denied for xxx/yyy, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I understand that since the Docker Hub repository is private the Pool needs the credentials to login, but actually I set the correct username and password in the Pool container registry. The container image name also is surely correct because is the same of the previous attempt. So what is the problem? Can Azure Batch pull a private Docker Hub repository?