Docker new Download Rate Limits
Tags: docker, kubernetes, architecture
Published: 2020-10-23 10:31:44

The new [Docker announcement](https://docs.docker.com/docker-hub/download-rate-limit/) could be a bit confusing, but in this blog post, I’ll try to summarize it and make it simpler to understand. On November 1st, Docker is planning to add a new [subscription level](https://www.docker.com/pricing), and here’s how this may affect us.

##The Problem

There are two main issues Docker users will now be facing: new pull request limitations, and the image retention policy.

##Pull request limitations

This new limitation means that we can create 100 pulls for anonymous users and 200 pulls for authorized users every 6 hours.

To better understand why rate limits were introduced, [Docker found that most Docker users pulled images at a rate you would expect for normal workflows.](https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/) However, there is an outsized impact from a small number of anonymous users. For example, roughly 30% of all downloads on Hub come from only 1% of our anonymous users.

The challenge is when pulling an existing image. Even if you don’t download the layers, this pull request will still be counted. 

![From Scaling Docker to Serve Millions More Developers: Network Egress](https://dev-to-uploads.s3.amazonaws.com/i/mn9vluq2v204pia3nmyf.png)

From Scaling Docker to Serve Millions More Developers: Network Egress

##Image retention policy

Images stored in free Docker Hub repositories that have not had their manifest pushed or pulled in the last 6 months, will be removed [at the mid of 2021.](https://www.docker.com/blog/docker-hub-image-retention-policy-delayed-and-subscription-updates/) This policy does not apply to images stored by paid Docker Hub subscription accounts, Docker verified publishers or [official Docker Images.](https://docs.docker.com/docker-hub/official_images/)

Let's take the following example of a free subscription user who pushed a tagged image called  "**batelt/froggy:v1**" to Docker Hub on Oct 21, 2019. If this tagged image was never pulled since it was pushed, it will be considered inactive by mid 2021 when the new policy takes effect. The image and any tag pointing to it will be subject to deletion.

According to their wiki, Docker will also be providing tooling, in the form of a UI and APIs, that will allow users to easily manage their images.

##The Solution

My favorite solution is to use [JFrog Artifactory](https://www.jfrog.com/confluence/display/jfrog/Installing+Artifactory) which is an artifact repository manager. This will allow us to store and protect our Docker images within a [private Docker registry,](https://www.jfrog.com/confluence/display/JFROG/Docker+Registry) keeping them in our cache using a [remote repository,](https://www.jfrog.com/confluence/display/JFROG/Repository+Management#RepositoryManagement-RemoteRepositories), reducing our requests to Docker hub and using our local images kept in cache as shown in the following diagram.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qaqhjxnb80mew7k23d60.jpg)

##Why should we use Artifactory and how it works

JFrog provides us with the ability to host our own secure private Docker registries and proxy external Docker registries. It even provides us with a smart [checksum-based storage.
](https://www.jfrog.com/confluence/display/JFROG/Checksum-Based+Storage) storage, which utilizes storage to maximum potential.

1. Choose Artifactory version ([Cloud](https://jfrog.com/platform/free-trial/) or [On-prem](https://jfrog.com/platform/free-trial/#hosted)) 
2. Create Docker repositories ([local](https://www.jfrog.com/confluence/display/JFROG/Docker+Registry#DockerRegistry-LocalDockerRepositories) [remote](https://www.jfrog.com/confluence/display/JFROG/Docker+Registry#DockerRegistry-RemoteDockerRepositories) and [virtual](https://www.jfrog.com/confluence/display/JFROG/Docker+Registry#DockerRegistry-VirtualDockerRepositories))
3. Configure repository advanced configuration

##Artifactory version 
If you don’t want to manage Artifactory you can just use the SaaS version which is free and limited. Or you can use the JFrog container registry that supports Docker and Helm repositories

##Create a Docker repository

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nlicv834hnjqq7bzucyv.gif)

##Configure repository advanced configuration 

Now we can easily [Configure repository advanced](https://www.jfrog.com/confluence/display/JFROG/Advanced+Settings) options like deciding how long before Artifactory checks for a newer version of a requested artifact in a remote repository and use our local caching so we will save our docker requests:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9807zntc4qshzbtye3g5.png)

[Learn more about Artifactory Pro](https://www.jfrog.com/confluence/display/JFROG/JFrog+Artifactory) that contains 27 different package types like Maven NPM and much more.