{"id":15638687,"url":"https://github.com/virtuald/docker-registry-cache","last_synced_at":"2025-04-30T06:23:44.316Z","repository":{"id":68763966,"uuid":"62832641","full_name":"virtuald/docker-registry-cache","owner":"virtuald","description":"A squid-based HTTP cache you can point at a private docker registry (v2 only)","archived":false,"fork":false,"pushed_at":"2018-03-22T02:12:21.000Z","size":12,"stargazers_count":94,"open_issues_count":2,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T13:23:37.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virtuald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-07-07T19:21:44.000Z","updated_at":"2024-12-11T15:43:27.000Z","dependencies_parsed_at":"2023-04-05T02:48:47.617Z","dependency_job_id":null,"html_url":"https://github.com/virtuald/docker-registry-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fdocker-registry-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fdocker-registry-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fdocker-registry-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fdocker-registry-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virtuald","download_url":"https://codeload.github.com/virtuald/docker-registry-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251652482,"owners_count":21621952,"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":[],"created_at":"2024-10-03T11:22:29.404Z","updated_at":"2025-04-30T06:23:44.292Z","avatar_url":"https://github.com/virtuald.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"docker-registry-cache\n=====================\n\nThis is a pull-through docker private registry cache implemented using a\nSquid HTTP proxy.\n\n**WARNING**: This only works with the modern [docker registry API (v2+)](https://docs.docker.com/registry/spec/api/). This will not work with docker registries that use the legacy v1 API. \n\nWhat is this useful for?\n------------------------\n\nBottom line, it's a HTTP cache. \n\n* Data center A contains your private registry, and DC B is connected to it over a slow link. Run an instance of this cache on DC B's network, and anytime you pull from it the second time will be significantly faster since you don't have to traverse that slow link as much!\n* I'm sure there are other usecases..\n\nRequirements\n============\n\nYou must have docker installed. You must create an SSL certificate and key for\nyour proxy (out of scope for this guide -- google it yourself).\n\nSSL-enabled squid\n-----------------\n\nYou must have an SSL-enabled version of squid. Currently, Ubuntu's squid\npackage is not ssl enabled due to licensing issues. To build your own, do this:\n\n```console\n$ build-squid/make.sh\n```\n  \nAfter about 30 minutes or so, you should have a bunch of deb packages in\nthe `build-squid` directory.\n\nBuild the cache server image\n----------------------------\n\nFirst, copy squid.conf.template to squid.conf, and change the variables.\n\n* `{{ docker_host }}` is your private docker registry host\n* `{{ cache_size }}` should be set to the cache size, in MB. According to the \n  squid docs, this should not exceed 80% of the disk. For example, 500000 is\n  500GB.\n\nNext, build the image:\n\n```console\n$ ./build.sh\n```\n    \nSetup\n=====\n\n* Create an empty directory for your cache.\n* Create a directory for your SSL certificates, and place them in a directory,\n  with the certificate called 'cert.pem' and the private key called 'key.pem'\n\n```console\n$ ./run.sh /path/to/ssl /path/to/cache\n```\n\nThe registry will start, and be listening on port 443. It should restart on\nbootup if your docker daemon is running.\n\nRegistry authentication\n-----------------------\n\nhttps://github.com/virtuald/docker-registry-cache/pull/7 added a configuration option\nto squid that passes basic authentication thru to the remote registry. This should\nwork without any further configuration.\n\nIt is unknown if other authentication schemes will work with this cache. Feel free\nto try it out and leave a note with what you find out!\n\nUsing the cache\n===============\n\nOnce the registry cache starts, you pull from it like you would pull from a\nnormal docker registry -- but you pull from the cache hostname, not your\noriginal private registry hostname!\n\n```console\n$ docker pull CACHE_HOST/foo/bar:latest\n```\n\nBugs\n====\n\nI'm sure this isn't ideal, but it seems to work. Submit issues and PRs!\n\nLicense\n=======\n\nThe contents of this repository are available under the Apache v2 license. \n\n\nAuthor\n======\n\nDustin Spicuzza (dustin@virtualroadside.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fdocker-registry-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirtuald%2Fdocker-registry-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fdocker-registry-cache/lists"}