Docker Hub rate limits in Bitbucket Pipelines

Docker recently announced that, starting November 1 2020, pull rate limits will apply to anonymous image pulls from Docker Hub. For anonymous (unauthenticated) users, pull rates are limited based on the individual IP address, and therefore some service disruption was expected for Docker Hub users.

Bitbucket is working with Docker to ensure that Bitbucket Pipelines users can continue transparently using Docker Hub without rate limits nor any configuration. This means that from November 1, your team will not be impacted by any rate limits when pulling images from Docker Hub when using Bitbucket Pipelines.

We encourage your team to add Docker Hub authentication and consider upgrading your Docker Hub plan, as appropriate, to prevent any impact from rate limits or any other limits in the future.

What if I'm already using a Pro or Team Docker Hub account?

Similar to anonymous users, no change will be required on your side to avoid any service disruption.

How do I authenticate to Docker Hub?

In order to authenticate to Docker Hub, you will need to pass user and password variables to the step, so the image can be properly pulled:

image:
  name: your_account/your_image
  username: $DOCKER_HUB_USERNAME
  password: $DOCKER_HUB_PASSWORD
pipelines:
  default:
    - step:
        script:
          - echo "Your step will use an authenticated image..."

Additionally, if you are using docker-in-docker:

pipelines:
  default:
    - step:
        services:
          - docker
        script:
          - cat $DOCKER_HUB_PASSWORD | docker login --username $DOCKER_HUB_USERNAME --password-stdin
          - docker pull your_account/your_image

For more details about authentication methods, refer to the using private build images section in the Use Docker images as build environments help document.

Happy coding!