Docker push to registry drops mid-push

I have configured a registry with gitlab and unfortunately it is currently dropping mid-push. It’s a push that takes awhile as the image is around 2Gb but still, it makes no sense the error message it’s giving me:

➜  myproject git:(master) ✗ docker login -u p@m.com -p ************** registry.mydomain.com    
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
➜  myproject git:(master) ✗ docker push registry.mydomain.com/myproject:foo
The push refers to a repository [registry.mydomain.com/myproject]
49f2b1087723: Layer already exists 
a6fcfd4a216f: Layer already exists 
b1f5bd0546bb: Pushing [==================================================>]  1.615GB
59b2e6f8cf4b: Layer already exists 
a39bd6666def: Layer already exists 
f06612f26b26: Layer already exists 
1274df611037: Layer already exists 
d703e2bcb94d: Layer already exists 
3358360aedad: Layer already exists 
unauthorized: authentication required

This happens over and over again and I just can’t seem to be able to push it. Is there a timeout from the docker login that’s registry dependent that I can increase?

1 Like

I have this exact same problem. I’ve tried the ‘trick’ recommended on other sites to login to the repo from a different shell every few minutes to re-initialize the token, but it does not work.

GitLab is the only image repository I have this problem with. We are in the process of migrating our images from our cloud provider to GitLab, and this is shutting that process down.

Any suggestions on how to fix it?