4

I have a problem pushing a large image to docker hub. I run/receive

docker login -u <username>

Login Succeeded

and when I push a small image to docker hub, everything goes smoothly. However, when I push a larger image (>1GB), this happens:

unauthorized: authentication required

To me it seems that my access token expires during the upload (as mentioned here: docker unauthorized: authentication required - upon push with successful login ) . There was also a hint, to use another terminal to login once more shortly before the push finishes, but this did not work for me.

The computer I use is behind a proxy with limited internet speed (and I cannot change that), so the upload takes roughly 15 minutes.

I tried to setup a dedicated access token in Docker hub, as described here https://docs.docker.com/docker-hub/access-tokens/ , but it seems that it is not possible to change the duration, how long this access token remains active.

My question is now, how do I increase the time that an access token is valid to allow also pushes that require 10+ minutes? I am using Docker version 19.03.6 on a Linux system.

Or could there be another reason the upload of a large image fails and I am looking into the wrong direction?

As described here (https://docs.docker.com/registry/spec/auth/token/) the Docker token has some expires_in field, but I do not know how to set it in the docker login-command or in the config.

Also, in some unrelated case there was a bug described that changes the default expires_in value from 3600s to 600s, here is the source: https://www.jfrog.com/jira/browse/RTFACT-26227 ). Not sure, if the same problem happens in my case as well.

Daniel Fischer
  • 3,280
  • 1
  • 18
  • 29

1 Answers1

0

My problem was my slow internet connection which always ended in a 600 seconds timeout.

I "solved" it by using a faster internet connection.

Sebastian Viereck
  • 5,455
  • 53
  • 53
  • Actually, I solved it in a similar fashion, I used a different computer that is not behind the slow proxy... But still, it is not a very satisfying solution – Daniel Fischer Jan 17 '23 at 08:08