Search code examples
dockerdocker-networkazure-container-registryazure-linuxdocker-push

Error while pushing Docker image on Azure Container Registry


I am getting below error when I run docker push command on my Azure Linux server,

The push refers to repository [prio.azurecr.io/prio-adi-piplines]
ea8e4df76021: Preparing
48b104cbbb7b: Preparing
ceaf9e1ebef5: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
error parsing HTTP 403 response body: unexpected end of JSON input: ""

I have simply updated our application.properties files with new secret key and executed mvn build commands and then docker build command both of them were successful.
After running those commands I ran docker push command Sudo docker push prio.azurecr.io/prio-adi-piplines:latest and I started getting above error.

I have a very limited knowledge on docker and I am not able to figure out exactly what is wrong.

Can anyone please guide me on how can I resolve this issue?


Solution

  • The "error parsing HTTP 403 response body: unexpected end of JSON input," indicates an issue with authenticating with the Azure Container Registry (ACR).

    Check the below points to configure things to ressolve the issue.

    1. If you are logging to ACR using the azure username and password, minimum acrpush role must be assigned to the user for pushing the images.

    enter image description here

    1. It's possible that firewall restrictions are preventing the successful retrieval of the JSON response from the ACR. Make sure that the necessary network ports are open, and there are no firewall rules blocking the communication between your client and the ACR.

    2. Verify virtual network configuration is allowing registry's public endpoint. To check the currently configured firewall rules,use below command.

    az acr show --query networkRuleSet --name <registry>.

    enter image description here4. Still if you are facing issue, create access token to repository as below and push the image. enter image description here Next click on Tokens to create token and generate a password to login with this particular scope. enter image description here

    Click on token, select actions and generate password. enter image description here

    login using the docker using the token and try to push image. enter image description here