Skip to content

How to add docker hub credentials to a project

Since 2nd November 2020, docker hub has imposed a rate limit for image pulls. For Rahti this means a limit of 200 pulls every 6 hours. This limit can be easily reached and it prevents new applications to be deployed if the image is in docker hub.

The error looks like this:

Pulling image "" ...
pulling image error : toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading:

The solution involves using both the Web UI and the client:

  • First, you need a docker hub account. It can be a free account. In this case you will still have rate limits, but only the pulls you have done using your credential will be taken into account for the rate limit. Paid accounts have no limit.

    • You will need a TOKEN, go to and create a token. You will be able to see when the token was last used. Also you can create several tokens, and use them in different projects, increasing security.
  • Secondly, navigate to the Web UI and open your project. On the left navigation, select Resources -> Secrets.

  • On upper right, select "Create Secret" button, and on the secret creation dialogue, set:

    • Secret Type = "Image Secret"
    • Secret Name = give it a clear name, this will be used later
    • Authentication Type = "Image Registry Credentials"
    • Image Registry Server Address = ""
    • Username = your docker user name
    • Password = your docker token
    • Email = your docker email

Note: Leave "Link secret to a service account." empty, we'll do this on command line.

create secret

  • Verify values are correct and select "Create".

  • Next we'll go to command line. Log in and use following commands to link credentials to service accounts:

$ oc -n <project-name> secrets link builder <secret-name> --for=pull
$ oc -n <project-name> secrets link deployer <secret-name> --for=pull
$ oc -n <project-name> secrets link default <secret-name> --for=pull

Note: Substitute place holder with actual project name (without <>) and with actual secret-name.


If the error persists, you may check two things:

  1. From you will be able to see when the token was last used. Please check that if the time there matches the last time it should have been used.

  2. Check that the links between the secret and the service accounts are there:

$ oc -n <project-name> describe sa builder
$ oc -n <project-name> describe sa deployer
$ oc -n <project-name> describe sa default

Note: Substitute place holder with actual project name (without <>).

Last update: November 26, 2020