Docker Push to ECR Failed with EOF

0

I've tried to push my image to my ECR registry but it failed with EOF. I've checked my network connection which is around 85mbps. My image size is just 510mb.

Even if i tried to push just an basic spring boot app its failing with EOF error. When i tried to push hello-world example of size 19kb to ECR, it was pushed successfully. I have followed several forums like upgrading docker and everything but nothing worked. Got stuck on this for a day, I'm not sure what to do as i'm new to docker world.

Docker Version

ashok@Ashoks-MacBook-Pro-2 wrapper % docker -v
Docker version 24.0.5, build ced0996600

Dockerfile

FROM openjdk:latest

ENV APP_HOME=/app

WORKDIR $APP_HOME

COPY target/wrapper-*.jar $APP_HOME/server.jar
COPY target/classes/application*.properties $APP_HOME/

ENV CONFIG_LOCATION=$APP_HOME/application.properties

#TODO
#VOLUME /config

EXPOSE 8080

# Run the application with the external properties file
CMD ["java", "-jar", "server.jar", "--spring.config.location=file:${CONFIG_LOCATION}"]

Getting the following error

ashok@Ashoks-MacBook-Pro-2 wrapper % docker push <myId>.dkr.ecr.ap-south-1.amazonaws.com/my-image:v1           
The push refers to repository [<myId>.dkr.ecr.ap-south-1.amazonaws.com/my-image]
209e1071257a: Retrying in 1 second 
c67b2b8209f1: Retrying in 1 second 
97b24c238bda: Retrying in 1 second 
b7f13fa277fd: Retrying in 1 second 
d18db2f65043: Retrying in 1 second 
6fbe0a91d471: Waiting 
EOF

Ashok
asked 21 days ago117 views
2 Answers
0

Hello.

There are several possible causes, but first, please make sure that the ECR repository URL and name are correct.
Also, make sure you are using the correct IAM user credentials (access key, secret access key) if you are running the command on your local PC.

You can also create Docker images with CloudShell, so try creating a container image with CloudShell instead of your local PC and push it to ECR.
https://docs.aws.amazon.com/cloudshell/latest/userguide/welcome.html

profile picture
EXPERT
answered 21 days ago
  • I've verified the credentials, urls and everything

  • Have you tried building a Docker image using CloudShell instead of your local PC and pushing it to ECR? By the way, is there a policy set for IAM users to push to ECR? At a minimum, the following IAM policy must be set. https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-push.html

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "ecr:CompleteLayerUpload",
                    "ecr:GetAuthorizationToken",
                    "ecr:UploadLayerPart",
                    "ecr:InitiateLayerUpload",
                    "ecr:BatchCheckLayerAvailability",
                    "ecr:PutImage"
                ],
                "Resource": "*"
            }
        ]
    }
    
  • Is there a way to debug to see whats happening inside docker daemon when i execute docker push in mac?

  • If you create "daemon.json" and configure as below, debugging will be enabled on the daemon, but I feel like I can't see the debug log of docker push. https://docs.docker.com/desktop/settings/mac/#docker-engine

    {
      "debug" : true
    }
    
  • i have even reinstalled docker in my machine.. I can able to push some sample images.. For Ex : busybox Not able to push my own image.

    Even if i set debug=true on docker desktop, i don't see anything on console while pushing docker images.

    { "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "experimental": false, "debug": true }

0

Have you already created a my-image repository in ECR? Or have you Typo it?

I thought that another possibility would be a problem with authentication, but since hello-world worked, I thought that the repository might not be ready.

profile picture
EXPERT
shibata
answered 21 days ago
  • I already created that repository and verified the name itself

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions