-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
N.B. This issue description will be updated as new information becomes available.
As of 2020-08-13, Docker have updated their terms of service and pricing page, indicating that:
- unauthenticated pulls will be rate limited to 100 per 6h
- authenticated pulls will be rate limited to 200 per 6h
The page on rate limits clarifies that this applies to layers being pulled, not images. Since most images comprise multiple layers, the effective image pull rate limit will be very low.
The rate limit page is inconsistent about the number, but also states that these rate limits are being introduced gradually.
Based on a recent build it does not appear that these rate limits are being enforced yet. However, it seems as though they will be in effect by 2020-11-01, so we need to understand the implications for various groups.
Implications
-
For environments where images are persisted between builds, the rate limit may not be hit. For ephemeral CI environments where images are discarded between builds, it seems more likely that the rate limit will be hit.
-
In general, all user groups may need to either:
- use an authenticated Docker Hub account for builds. This page describes how this can be set up.
- testcontainers-java has good support for authenticated image pulls. Other language forks will need work done.
- Docker Hub's Free/Pro/Team plans will allow 300/unlimited/unlimited layer pulls per 6h.
- OR, users may wish to set up their own registry to mirror/copy images which they require. This is already possible, and work is underway within Testcontainers to continue to make this easier.
- use an authenticated Docker Hub account for builds. This page describes how this can be set up.
-
user groups with low image pulling requirements (e.g. few images or a low rate of builds) will presumably not be impacted.
For open source projects using Testcontainers within their builds (including Testcontainers itself)
- per https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/, an open source project plan will be available with free unlimited pulls, and Docker have an application form here: forms.gle/vvKURDTYwok7Pc4r5
- For projects using GitHub Actions: GitHub Actions will have mitigation in place to prevent rate limits from affecting builds.
- For projects not using GitHub Actions: For projects that set up authenticated pulls in their CI infrastructure, it is not clear what approach should be followed for repository forks. Using build secrets to hold Docker Hub auth tokens means it will not be available to forks.
For companies using Testcontainers within their builds
- If Hub's rate limiting is based on IP address, and if developers share an IP address, it seems possible that rate limits could apply to developers as well as CI infrastructure.
- For projects that set up authenticated pulls in their CI infrastructure, it is also not clear what approach should be followed for repository forks. Using build secrets to hold Docker Hub auth tokens means it will not be available to forks, although in a company environment this may be more manageable.
- Companies may be more likely to have private docker registries (e.g. ECR, GCR) which they can copy required images to. Testcontainers will implement an image substitution mechanism to allow private registry image names to be used as substitutes for public Docker Hub images (see below).
Actions for users
- Be mindful that rate limits may apply soon, and some preparation will be needed. Consider the above options and implement.
- Please help clarify open questions if you have additional information.
Actions for Testcontainers team
-
Set up authenticated pulls for Testcontainers' own builds (N.B. this refers to adding
docker loginto our CI scripts. Authenticated pull support is already implemented in testcontainers-java)- GitHub Actions - skip, not needed
- CircleCI, Azure Pipelines for Linux, Travis - switch to master branch only and use secrets
- Azure Pipelines for Windows (triggered by maintainer PR comments) - use secrets
-
Implement transparent 'image substitution' (whereby Testcontainers will consult a user-provided piece of code to obtain an alias for an image, which may reside on a private registry). PR: Image substitution #3102
-
Investigate the possibility of providing an implementation of image substitution that treats GitHub Packages as a cache.
-
Retrofit to language forks: authenticated image pulls and image substitution
-
Improve documentation around authenticated image pulls and options for mirroring registries / copying images to non-Hub registries
Open questions
-
When will rate limits noticeably kick in? Unclear: nominally 1st November, but some Docker/Testcontainers users have reported rate limiting already
- Docker have said that IPs pulling the highest volume will be experiencing the rate limit earlier. All other signs point to 1st November being the start.
-
Are CI platforms going to attempt to mitigate this?
- GitHub Actions: YES
- Others, no information yet
-
Is there a separate Free plan for Open Source projects that allows unlimited pulls? Yes, see https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/
-
How should repo forks manage the need to provide Hub credentials?
- Aside from GitHub Actions providing a different approach to mitigation, it appears there is no solution to this problem for other CI platforms.
- teams using their own CI executors may find other mitigations, such as configuring a local docker registry server to act as an authenticated mirror.