I have web app with docker container. I add Azure Container registry and add to app. Also I enabled admin user in container. Then i use following command:
docker build -t clothinginsecuritydocker.azurecr.io/prod:latest
docker login clothinginsecuritydocker.azurecr.io
docker push clothinginsecuritydocker.azurecr.io/prod:latest
After that i connect github actions and deploy was success. But after that I always get the error:
2023-10-09T16:17:45.672Z ERROR - failed to register layer: Error processing tar file(exit status 1): Container ID 718322462 cannot be mapped to a host IDErr: 0, Message: failed to register layer: Error processing tar file(exit status 1): Container ID 718322462 cannot be mapped to a host ID
2023-10-09T16:17:45.694Z INFO - Pull Image failed, Time taken: 0 Minutes and 47 Seconds
2023-10-09T16:17:45.695Z ERROR - Pulling docker image clothinginsecuritydocker.azurecr.io/clothinginsecuritydocker/prod:ba2cad09552128b3aabfc6a7d526c71dd4adc7d4 failed:
2023-10-09T16:17:45.988Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Head \"https://clothinginsecuritydocker.azurecr.io/v2/clothinginsecuritydocker/prod/manifests/ba2cad09552128b3aabfc6a7d526c71dd4adc7d4\": unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information."}
2023-10-09T16:17:45.989Z WARN - Image pull failed. Defaulting to local copy if present.
2023-10-09T16:17:45.999Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2023-10-09T16:17:46.009Z INFO - Stopping site clothinginsecurityserver because it failed during startup.
I tried to do it without actions it didn't help. I have all values in configuration as well. I tried to login with azurecli with command:
az acr login --name clothinginsecuritydocker.azurecr.io
Try below steps to fix the issue:
Docker CLI and daemon
are running in your environment.Registry name
or thecredentials
you are using should be correct.Selected Networks
like specific virtual networks or IP addresses.Check if you have the required permissions to push or pull images from your registry, like
AcrPush
orAcrPull
role assigned to your user or service principal.Delete the Docker image from your Azure Container Registry and push it again. You can use the following commands to delete the Docker image: