Guides

Docker

#

Docker Rate Limiting and Authentication

Docker Hub began rate limiting anonymous accounts in November 2020. As a result, you may occasionally encounter rate limiting issues while using BuildJet, since you share an outgoing IP with other runs within our network. Unlike with native GitHub Actions runners, which have a custom agreement with Docker Hub, you may need to authenticate your Docker Hub account to avoid these issues.

#

Setting up a Docker Hub Account

To resolve rate limiting issues, we recommend creating a free Docker Hub account. You can sign up here and follow the FAQ item on how to authenticate GitHub Actions jobs.

#

Authenticating container and services

Job and Service containers in GitHub Actions allow you to containerize your CI environment and make databases, caches, or other services available to your tests. Since BuildJet does not have a custom agreement with Docker Hub, you'll need to authenticate your containers and services as well.

Authenticating your containers and services is simple. First, create a secret in your workflow and then use them in the container and services credentials to set the username and password.

yaml
1
jobs:
2
build:
3
container:
4
image: node:10.16-jessie
5
credentials:
6
username: ${{ secrets.docker_hub_username }}
7
password: ${{ secrets.docker_hub_password}}
8
services:
9
db:
10
image: node:10.16-jessie
11
credentials:
12
username: ${{ secrets.docker_hub_username }}
13
password: ${{ secrets.docker_hub_password}}

By following these steps, you can authenticate your Docker Hub account and avoid rate limiting issues while using BuildJet with GitHub Actions.

#

Docker Layer Caching

Docker layer caching is a feature of Docker BuildKit that allows Docker to reuse the layers from previous builds, leading to much faster build times. However, if you're using Docker's experimental docker layer caching type=gha, you may encounter instability and speed issues as we discussed in our BuildJet Cache launch post.

To avoid these issues, we recommend using Docker's inline cache. Head over to our BuildJet Cache migration guide to learn more.