21

I try to push an image in my public docker repository, but after some minutes I have this problem:

enter image description here

and during pushing, the following occurs many times (when retrying):

enter image description here

My version of docker is the following:

enter image description here

How to solve this problem ?

Hermann.Gruber
  • 1,257
  • 1
  • 12
  • 37
daniele3004
  • 13,072
  • 12
  • 67
  • 75

9 Answers9

27

docker push to ECR error When I push an image to ECR, an EOF error occured. The reason is remote repository[jdk-8-newrelic] does not exist. After creating the repository, PUSH succeeded.

Ridox
  • 1,073
  • 13
  • 18
  • 2
    This pointed me in the right direction: Terraform was creating the image repository with a different name from the one I was passing to `docker push`. – Paul Mar 04 '22 at 03:21
  • My issue was similar. I forgot to give myself permission to the repo. – Kyle May 16 '23 at 20:53
16

I got this error when my image name was incorrectly formatted. I was trying to push an image called registry-url/my-repository/my-image-name:tag This is wrong; I need a repository per image name. registry-url/my-image-name:tag worked, once I created the repository named my-image-name.

This was on ECR.

Jessitron
  • 1,350
  • 13
  • 12
10

I was missing this policy AmazonEc2COntainerRegistryFullAccess in permission of the iam user

Jose K J
  • 121
  • 1
  • 6
5

If you have profiles under ~/.aws/credentials (linux), you might need to specify profile name

aws ecr get-login-password  --profile <PROFILE-NAME>  | docker login --username AWS --password-stdin <ECR_NAME>.dkr.ecr.<REGION>.amazonaws.com
Alijvhr
  • 1,695
  • 1
  • 3
  • 22
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 10 '23 at 12:41
  • This answer helped me figure out my problem, and that was because I have multiple AWS accounts for various environments and I was using the default one mistakenly when authenticating with ECR for docker login. Thanks. – Jonathan Kretzmer May 29 '23 at 13:30
  • Make you are connected to right profile with ECR access. – prayagupa Aug 29 '23 at 22:43
4

In case you are trying to push into the AWS ECR, this happens when the connection to the repository has failed. This could be either because

  1. the repository doesn't exist
  2. the repository exists but in a different region
  3. the AWS credentials are incorrect.
  4. the AWS credentials have just been corrected

Once you have the repository created in the correct region and the AWS cli Credentials are corrected, ensure that you run the AWS docker login command once again and repeat the tag and push steps.

sydadder
  • 354
  • 2
  • 15
0

I have met this issue nowadays when I am pushing an image to a private registry. And I checked out the Docker log and found that there was something unexpected about the proxy but I did not have to push to my private through the proxy. So I added my registry address to the Docker proxy whitelist to skip the proxy, and it worked. I wish it helps!

0

I had a similar problem pushing to a private docker repository, and the problem was wrong credentials.

Try to read the logs:

Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time

ref: https://learn.microsoft.com/en-us/virtualization/windowscontainers/troubleshooting#finding-logs

Douglas Alves
  • 51
  • 1
  • 5
0

In my case, I had saved AWS credentials from another account where I did not have full access anymore. Check your C:\Users\YourUserName.aws\credentials if you are on Win.

Anatoly Alekseev
  • 2,011
  • 24
  • 27
0

Yes, You need to create a repository in AWS ECR. PFB for AWS AC.

docker push aws-ac-id.dkr.ecr.us-west-2.amazonaws.com/build-agent:latest

Here I have created a build-agent ECR repository and the above command got successful. Don't forget to run the below command.

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin aws-ac-id.dkr.ecr.us-west-2.amazonaws.com

saurabh raj
  • 470
  • 4
  • 4