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.
-
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)
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
Open questions
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:
The page on rate limits clarifies that this applies
to layers being pulled, notimages.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:
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)
For companies using Testcontainers within their builds
Actions for users
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)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
Are CI platforms going to attempt to mitigate this?
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?