script to dummy-pull all container images from a repo at a container registry to avoid inactivity purge
docker run --rm -ti docker.io/chko/pull2null docker.io/my-user/my-repo
To increase the rate limit you can login
docker run --rm -ti -e 'INPUT_DOCKER_USER=my-user' -e 'INPUT_DOCKER_PASSWORD=my-password' -e 'INPUT_REGISTRY_SERVER=docker.io' docker.io/chko/pull2null docker.io/my-user/my-repo
Usage:
pull2null [flags] NAME
Description:
script to "dummy"-pull all container images for a given container repo name
(to prevent the container registry to purge images after a periode of inactivity)
Flags:
--dry-run get metadata but does not actually pull (warning: login will persist!)
--no-delete dont delete layers between pulls (prevents that layers get downloaded more
then once, but needs more disk space)
-h, --help help for this command
Args:
NAME container repo (example: docker.io/my-user/my-repo)
Optional env vars for Docker Login (to increase the rate limit):
INPUT_DOCKER_USER username for container registry
INPUT_DOCKER_PASSWORD password for container registry
INPUT_REGISTRY_SERVER the registry server name (for Docker Hub use: \"docker.io\" )
Yes
Docker Hub pull rate limits currently seem to be at 100 pulls per 6 hours for unauthenticated user, 200 for authenticated users and unlimited (or so) for paid accounts. You can pass a registry login to the script via env vars (see example above) to increase the rate limit. To see how many pulls would be necessary for a particular repo you can run --dry-run
that prints the count.
Partly. It doesn't pull an image twice, even if that image is available under multiple tags. However by default it doesn't keep layers between pulls as it's intended to run on small CI runners and cloud instances with not much disk space. If you have enough disk space you can use --no-delete
, which leads to less downloads. Please don't run this script more often then necessary (i.e. every 6 months) to not cause unnecessary traffic for your registry provider.
- new Docker Hub retention limit (starting
1-Nov-2020)mid 2021): FAQ and blog post and blog update (delay to mid 2021) - new Docker Hub pull rate limits: blog post