Reputation: 6040
I am following this article. I have an Azure container registry as shown below image and I have defined the task as below.
az acr task create \
--name krushnaTask \
--registry krushna \
--cmd python-hello \
--schedule "1 10 * * *" \
--context /dev/null
When the Azure is running the task it is giving below error :
2020/06/02 11:02:03 Alias support enabled for version >= 1.1.0, please see https://aka.ms/acr/tasks/task-aliases for more information.
2020/06/02 11:02:03 Creating Docker network: acb_default_network, driver: 'bridge'
2020/06/02 11:02:03 Successfully set up Docker network: acb_default_network
2020/06/02 11:02:03 Setting up Docker configuration...
2020/06/02 11:02:04 Successfully set up Docker configuration
2020/06/02 11:02:04 Logging in to registry: krushna.azurecr.io
2020/06/02 11:02:05 Successfully logged into krushna.azurecr.io
2020/06/02 11:02:05 Executing step ID: acb_step_0. Timeout(sec): 3600, Working directory: '', Network: 'acb_default_network'
2020/06/02 11:02:05 Launching container with name: acb_step_0
Unable to find image 'python-hello:latest' locally
docker: Error response from daemon: pull access denied for python-hello, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
2020/06/02 11:02:05 Container failed during run: acb_step_0. No retries remaining.
failed to run step ID: acb_step_0: exit status 125
What can be done so the ACR task can access the docker image?
Upvotes: 0
Views: 2991
Reputation: 31384
I'm pretty sure the problem is that you need to input the image as krushna.azurecr.io/python-hello:tag
since the image is in your ACR. When you input the image as python-hello
, it means it's a public docker image in Docker hub, so it caused the error because it cannot find the image in the Docker hub. Change the command like below and it will work well:
az acr task create \
--name krushnaTask \
--registry krushna \
--cmd krushna.azurecr.io/python-hello \
--schedule "1 10 * * *" \
--context /dev/null
Upvotes: 2
Reputation: 1618
When creating ACR Tasks, you should provide a git-access-token if your registry has RBAC enabled
--git-access-token
The access token used to access the source control provider.
https://learn.microsoft.com/en-us/cli/azure/acr/task?view=azure-cli-latest#az-acr-task-create
you can create the access token from this DOC
Upvotes: 0