{"id":21048264,"url":"https://github.com/angelbarrera92/dockerhub-mutator","last_synced_at":"2026-05-08T14:49:34.339Z","repository":{"id":144305460,"uuid":"309770938","full_name":"angelbarrera92/dockerhub-mutator","owner":"angelbarrera92","description":"Kubernetes mutator to change any container image to be downloaded from google mirror instead of downloading directly from Docker Hub","archived":false,"fork":false,"pushed_at":"2020-11-14T12:24:27.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-18T16:48:33.949Z","etag":null,"topics":["cert-manager","cncf","docker","dockerhub","google-mirror","kubernetes","mutator","webhook","youwillnevercodealone"],"latest_commit_sha":null,"homepage":"","language":"Python","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/angelbarrera92.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":"2020-11-03T18:16:11.000Z","updated_at":"2021-08-04T10:20:14.000Z","dependencies_parsed_at":"2024-08-24T20:34:46.031Z","dependency_job_id":null,"html_url":"https://github.com/angelbarrera92/dockerhub-mutator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angelbarrera92/dockerhub-mutator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelbarrera92%2Fdockerhub-mutator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelbarrera92%2Fdockerhub-mutator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelbarrera92%2Fdockerhub-mutator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelbarrera92%2Fdockerhub-mutator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angelbarrera92","download_url":"https://codeload.github.com/angelbarrera92/dockerhub-mutator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelbarrera92%2Fdockerhub-mutator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32785398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cert-manager","cncf","docker","dockerhub","google-mirror","kubernetes","mutator","webhook","youwillnevercodealone"],"created_at":"2024-11-19T14:42:55.344Z","updated_at":"2026-05-08T14:49:34.304Z","avatar_url":"https://github.com/angelbarrera92.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Hub Mutator\n\n\u003e Original idea from the #YouWillNeverCodeAlone group.\n\nKubernetes mutator to change any container image to be downloaded from google mirror instead of downloading directly from Docker Hub.\nIt should avoid the [new rate limit Docker inc is setting up in its Hub](https://docs.docker.com/docker-hub/download-rate-limit/).\n\n## Disclaimer\n\nProject current state: **POC**.\nIt has some pending points to be implemented before consider it a beta software.\n\n- [ ] Deployed in the default namespace *(hardcoded)*\n    - [ ] Helm Chart\n- [ ] Logging\n- [ ] Metrics\n\n## Run it in your cluster\n\n### Requirements\n\nAn already working Kubernetes cluster with [cert-manager](https://github.com/jetstack/cert-manager) installed.\n\n### Deploy\n\nThe container image with the mutator is available at the GitHub Container Registry: `ghcr.io/angelbarrera92/dockerhub-mutator:latest`.\n\n```bash\n$ docker pull ghcr.io/angelbarrera92/dockerhub-mutator:latest\n```\n\nAvailable for the following architectures:\n\n- `linux/amd64`\n- `linux/arm/v6`\n- `linux/arm/v7`\n- `linux/arm64`\n\n\nDeploy the solution using the following commands:\n\n```bash\n$ kubectl apply -f https://raw.githubusercontent.com/angelbarrera92/dockerhub-mutator/master/hack/deploy.yaml\nissuer.cert-manager.io/mutator-root created\ncertificate.cert-manager.io/mutator-root-ca created\nissuer.cert-manager.io/mutator-root-ca created\ncertificate.cert-manager.io/dockerhub-mutator created\ndeployment.apps/dockerhub-mutator created\nservice/dockerhub-mutator created\n$ kubectl apply -f https://raw.githubusercontent.com/angelbarrera92/dockerhub-mutator/master/hack/mutation.yaml\nmutatingwebhookconfiguration.admissionregistration.k8s.io/dockerhub-mutator created\n```\n\n## Run it locally\n\n### Requirements\n\nCreate a local [kind](https://github.com/kubernetes-sigs/kind) cluster then install [cert-manager](https://github.com/jetstack/cert-manager):\n\n```bash\n$ kind create cluster\nCreating cluster \"kind\" ...\n ✓ Ensuring node image (kindest/node:v1.19.1) 🖼\n ✓ Preparing nodes 📦\n ✓ Writing configuration 📜\n ✓ Starting control-plane 🕹️\n ✓ Installing CNI 🔌\n ✓ Installing StorageClass 💾\nSet kubectl context to \"kind-kind\"\nYou can now use your cluster with:\n\nkubectl cluster-info --context kind-kind\n\nHave a nice day! 👋\n$ kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.4/cert-manager.yaml\ncustomresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created\ncustomresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created\ncustomresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created\ncustomresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created\ncustomresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created\ncustomresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created\nnamespace/cert-manager created\nserviceaccount/cert-manager-cainjector created\nserviceaccount/cert-manager created\nserviceaccount/cert-manager-webhook created\nclusterrole.rbac.authorization.k8s.io/cert-manager-cainjector created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-issuers created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificates created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-orders created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-challenges created\nclusterrole.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created\nclusterrole.rbac.authorization.k8s.io/cert-manager-view created\nclusterrole.rbac.authorization.k8s.io/cert-manager-edit created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-cainjector created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-issuers created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificates created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-orders created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-challenges created\nclusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created\nrole.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created\nrole.rbac.authorization.k8s.io/cert-manager:leaderelection created\nrole.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created\nrolebinding.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created\nrolebinding.rbac.authorization.k8s.io/cert-manager:leaderelection created\nrolebinding.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created\nservice/cert-manager created\nservice/cert-manager-webhook created\ndeployment.apps/cert-manager-cainjector created\ndeployment.apps/cert-manager created\ndeployment.apps/cert-manager-webhook created\nmutatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created\nvalidatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created\n```\n\n### Build and deploy\n\nWait until all cert-manager containers are running, then after cloning this repository, run the following commands:\n\n```bash\n$ docker build -q --no-cache -t ghcr.io/angelbarrera92/dockerhub-mutator:latest .\nsha256:b97575883f02cd3dcdf0a9334ff88850f7dbc9dc00064e54c6188b9c4bde4afe\n$ kind load docker-image ghcr.io/angelbarrera92/dockerhub-mutator:latest\nImage: \"ghcr.io/angelbarrera92/dockerhub-mutator:latest\" with ID \"sha256:b97575883f02cd3dcdf0a9334ff88850f7dbc9dc00064e54c6188b9c4bde4afe\" not yet present on node \"kind-control-plane\", loading...\n$ kubectl apply -f hack/deploy.yaml\nissuer.cert-manager.io/mutator-root created\ncertificate.cert-manager.io/mutator-root-ca created\nissuer.cert-manager.io/mutator-root-ca created\ncertificate.cert-manager.io/dockerhub-mutator created\ndeployment.apps/dockerhub-mutator created\nservice/dockerhub-mutator created\n$ kubectl apply -f hack/mutation.yaml\nmutatingwebhookconfiguration.admissionregistration.k8s.io/dockerhub-mutator created\n```\n\n## Test it\n\nOnce everything is placed, create a deployment\n\n```bash\n$ kubectl create deployment example-mutation --image=nginx:latest\ndeployment.apps/example-mutation created\n```\n\nInspect the deployment:\n\n```bash\n$ kubectl get deployment example-mutation -o jsonpath='{.metadata.labels.mutated}'\nyes\n$ kubectl get deployment example-mutation -o jsonpath='{.spec.template.spec.containers[0].image}'\nmirror.gcr.io/library/nginx:latest\n```\n\nThe image name has been changed. Now it is configured to use the `mirror.gcr.io` google container registry.\n\n\n## Thanks\n\nThanks to [@javierprovecho](https://github.com/javierprovecho) to participate in the live coding session at twitch. We built it together!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelbarrera92%2Fdockerhub-mutator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelbarrera92%2Fdockerhub-mutator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelbarrera92%2Fdockerhub-mutator/lists"}