{"id":13587209,"url":"https://github.com/lhns/docker-registry-cache","last_synced_at":"2025-06-15T04:34:19.054Z","repository":{"id":39802673,"uuid":"326829581","full_name":"lhns/docker-registry-cache","owner":"lhns","description":"multi-registry docker image cache","archived":false,"fork":false,"pushed_at":"2024-05-17T01:10:21.000Z","size":262,"stargazers_count":10,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-17T22:47:55.432Z","etag":null,"topics":["cache","docker","image","multi","proxy","registry","s3"],"latest_commit_sha":null,"homepage":"https://github.com/users/lhns/packages/container/package/docker-registry-cache","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lhns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-04T23:09:13.000Z","updated_at":"2024-08-01T16:33:12.469Z","dependencies_parsed_at":"2024-04-18T02:25:35.125Z","dependency_job_id":"9da03151-bfaa-4a87-bfe1-39f1c7596fa4","html_url":"https://github.com/lhns/docker-registry-cache","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhns%2Fdocker-registry-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhns%2Fdocker-registry-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhns%2Fdocker-registry-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhns%2Fdocker-registry-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lhns","download_url":"https://codeload.github.com/lhns/docker-registry-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243941160,"owners_count":20372194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","docker","image","multi","proxy","registry","s3"],"created_at":"2024-08-01T15:06:06.120Z","updated_at":"2025-03-18T17:31:21.280Z","avatar_url":"https://github.com/lhns.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"# docker-registry-cache\n\n[![Docker Workflow](https://github.com/lhns/docker-registry-cache/workflows/build/badge.svg)](https://github.com/lhns/docker-registry-cache/actions?query=workflow%3Abuild)\n[![Release Notes](https://img.shields.io/github/release/lhns/docker-registry-cache.svg?maxAge=3600)](https://github.com/lhns/docker-registry-cache/releases/latest)\n[![Apache License 2.0](https://img.shields.io/github/license/lhns/docker-registry-cache.svg?maxAge=3600)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)\n\nA multi-registry docker image cache.\n\nIt uses Docker's official [registry](https://docs.docker.com/registry/) internally and spawns one instance for each\nconfigured registry while it proxies requests to the corresponding registry.\n\n## Usage\n\nInstead of `my/image:latest` you just specify `127.0.0.1:5000/my/image:latest`.\n\nThis also works for `127.0.0.1:5000/ghcr.io/my/image:latest` and `127.0.0.1:5000/debian`.\n\n## Installation\n\n- Deploy the stack config as shown below\n- Add the following to your `/etc/docker/daemon.json`:\n```yml\n{\n  \"insecure-registries\" : [\"127.0.0.1:5000\"]\n}\n```\n\n- Restart the docker daemon (or [reload](https://gist.github.com/lhns/72fb1dfba4d0dada78ba7d9b69ed76de))\n- Change all image references that you want to cache from `my/image:latest` to `127.0.0.1:5000/my/image:latest`\n\n## Stack Config\n\n### Filesystem Storage Backend\n\n```yml\nversion: '3.8'\n\nservices:\n  proxy:\n    image: ghcr.io/lhns/docker-registry-cache:0.3.0\n    environment:\n      CONFIG: |\n        [\n          {\"registry\": \"registry-1.docker.io\", \"variables\": {\"REGISTRY_PROXY_USERNAME\": \"my_dockerhub_id\", \"REGISTRY_PROXY_PASSWORD\": \"my_dockerhub_token\"}},\n          \"ghcr.io\",\n          \"gcr.io\"\n        ]\n      #REGISTRY_STORAGE_DELETE_ENABLED: 'true' bug https://forums.docker.com/t/private-registry-not-working-after-deleting-an-image/105227\n    volumes:\n      - /docker-registry-cache:/var/lib/registry\n    ports:\n      - \"5000:5000\"\n  zzz_proxy:\n    # This dummy service prevents the image from getting pruned\n    image: ghcr.io/lhns/docker-registry-cache:0.3.0\n    entrypoint: tail -f /dev/null\n    deploy:\n      mode: global\n```\n\n### MinIO Storage Backend\n\n```yml\nversion: '3.8'\n\nservices:\n  proxy:\n    image: ghcr.io/lhns/docker-registry-cache:0.3.0\n    environment:\n      CONFIG: |\n        [\n          {\"registry\": \"registry-1.docker.io\", \"variables\": {\"REGISTRY_PROXY_USERNAME\": \"my_dockerhub_id\", \"REGISTRY_PROXY_PASSWORD\": \"my_dockerhub_token\"}},\n          \"ghcr.io\",\n          \"gcr.io\"\n        ]\n      REGISTRY_STORAGE: 's3'\n      REGISTRY_STORAGE_S3_BUCKET: 'registry'\n      REGISTRY_STORAGE_S3_REGION: 'minio'\n      REGISTRY_STORAGE_S3_REGIONENDPOINT: 'http://s3:9000'\n      REGISTRY_STORAGE_S3_ACCESSKEY: 'minioadmin'\n      REGISTRY_STORAGE_S3_SECRETKEY: 'minioadmin'\n      #REGISTRY_STORAGE_DELETE_ENABLED: 'true' bug https://forums.docker.com/t/private-registry-not-working-after-deleting-an-image/105227\n    networks:\n      - s3\n    ports:\n      - \"5000:5000\"\n    deploy:\n      update_config:\n        order: start-first\n  s3:\n    image: minio/minio\n    entrypoint: /bin/sh -c 'mkdir /data/registry \u0026 exec /usr/bin/docker-entrypoint.sh \"$$@\"' --\n    command: server --address 0.0.0.0:9000 /data\n    environment:\n      MINIO_ACCESS_KEY: 'minioadmin'\n      MINIO_SECRET_KEY: 'minioadmin'\n    volumes:\n      - /docker-registry-cache:/data\n    networks:\n      - s3\n    healthcheck:\n      test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:9000/minio/health/live\"]\n      interval: 15s\n  zzz_proxy:\n    # This dummy service prevents the image from getting pruned\n    image: ghcr.io/lhns/docker-registry-cache:0.3.0\n    entrypoint: tail -f /dev/null\n    deploy:\n      mode: global\n  zzz_s3:\n    # This dummy service prevents the image from getting pruned\n    image: minio/minio\n    entrypoint: tail -f /dev/null\n    deploy:\n      mode: global\n\nnetworks:\n  s3:\n    driver: overlay\n```\n\n### Example Service\n\n```yml\nversion: '3.8'\n\nservices:\n  traefik:\n    image: 127.0.0.1:5000/traefik\n```\n\n### Corporate Proxy\n\n```yml\n    environment:\n      http_proxy: 'https://my-proxy:8080'\n      https_proxy: 'https://my-proxy:8080'\n      no_proxy: '127.0.0.0/8,localhost,s3'\n```\n\n## Environment Variables\n\n**CONFIG** must contain a JSON list of either registry host strings or objects with the following structure `{\"registry\": \"ghcr.io\", \"variables\": {\"TEST\": \"foo\"}}`\n\nThe internally spawned registry processes will also inherit all environment variables so you can configure all internal registries as described in the [official documentation](https://docs.docker.com/registry/configuration/).\nYou can also configure the internal registries individually using the `variables` section in the aforementioned JSON structure.\n\n## Docker builds\n\nhttps://github.com/users/lhns/packages/container/package/docker-registry-cache\n\nhttps://hub.docker.com/r/lolhens/docker-registry-cache\n\n## License\n\nThis project uses the Apache 2.0 License. See the file called LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhns%2Fdocker-registry-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flhns%2Fdocker-registry-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhns%2Fdocker-registry-cache/lists"}