Passed in credentials for service containers not being used for public dockerhub regsistry

Dockerhub has recently imposed rate limiting for anonymous pulls: https://www.docker.com/increase-rate-limits?utm_source=docker&utm_medium=web%20referral&utm_campaign=increase%20rate%20limit&utm_budget=

When specifying docker credentials in a service image specification for a public image on dockerhub, it does not try to authenticate, leading to a rate limiting error.

Eg.

    services:
      postgres:
        image: postgres
        credentials:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

Does not work, but

    container:
      image: smartcontract/builder:1.0.37
      credentials:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}

does.

@HenryNguyen5,

According to my test:

  1. When using a public and private image from Docker Hub to set job containers in the workflow, I can see the login process in the “Initialize containers” steps. See this example.

  2. When using a public and private image from Docker Hub to set service containers in the workflow, I also can see the login process in the “Initialize containers” steps. See this example.

If possible, please share your repository with us, so that we can check more details in your workflow and the workflow runs to analyze the root cause.

Hi @brightran, I must have missed the step, or looked at an old job run, seems like its authing properly now, thank you!

@HenryNguyen5,

So, the problem does no longer bother you. Glad to hear that.