GitHub Actions users now prepare for Docker Hub pull limits

2020/10/27 postscript

There is no official announcement yet, but when the company contacted GitHub support,

These rate limits will not apply to any Docker Hub connections from GitHub Actions workflows.

I received the answer.

The following actions are likely to be ** unnecessary. ** **

Problems that occur

Starting November 2020, Docker Hub will limit the number of pulls for users who are not logged in. Or rather, it has already begun in stages.

-Official Announcement (English) -Docker Hub pull limit has already started

Also about GitHub Actions

toomanyrequests: Too Many Requests. Please see https://docs.docker.com/docker-hub/download-rate-limit/

Docker image pull fails with the error and the workflow is likely to fail (I haven't had an error yet)

counter-measure

As introduced in Official Announcement (English), [docker / login-action](https://github. Let's use com / docker / login-action # dockerhub).

Yaml after correspondence

workflow.yml


jobs:
  HogeHogeJob:
    name: HogeHogeJob
    runs-on: ubuntu-latest
    steps:
      #Add these 5 lines
      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      #The rest is fine as before
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup python
        uses: actions/setup-python@v2
        with:
          python-version: 3.7

Register DOCKERHUB_USERNAME and DOCKERHUB_TOKEN on GitHub as secrets in advance (Official Doc encrypted-secrets #% E3% 83% AA% E3% 83% 9D% E3% 82% B8% E3% 83% 88% E3% 83% AA% E3% 81% AE% E6% 9A% 97% E5% 8F % B7% E5% 8C% 96% E3% 81% 95% E3% 82% 8C% E3% 81% 9F% E3% 82% B7% E3% 83% BC% E3% 82% AF% E3% 83% AC % E3% 83% 83% E3% 83% 88% E3% 81% AE% E4% BD% 9C% E6% 88% 90))

Please note that it is recommended to use an Access Token for ** DOCKERHUB_TOKEN instead of a password **. It works with a password, but let's issue an Access Token properly.

How to issue an Access Token

  1. Log in to https://hub.docker.com/
  2. Account Settings from the user name in the upper right
  3. Security-> New Access Token-> Then get on the flow スクリーンショット 2020-10-21 20.28.35.png

Register the issued Access Token as DOCKERHUB_TOKEN and you're done. You will be able to log in with docker / login-action.

Recommended Posts

GitHub Actions users now prepare for Docker Hub pull limits
About Docker Hub pull limit
Docker Hub pull limit has already begun
CI for Maven project at Github Actions