{"id":25239277,"url":"https://github.com/seatgeek/docker-mirror","last_synced_at":"2025-10-26T14:30:43.537Z","repository":{"id":33858982,"uuid":"154222125","full_name":"seatgeek/docker-mirror","owner":"seatgeek","description":"Mirror docker images across image repositories","archived":false,"fork":false,"pushed_at":"2023-11-13T11:58:33.000Z","size":308,"stargazers_count":143,"open_issues_count":24,"forks_count":43,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-06-18T21:42:52.461Z","etag":null,"topics":["docker","mirror"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seatgeek.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":"2018-10-22T21:50:57.000Z","updated_at":"2024-06-08T09:42:04.000Z","dependencies_parsed_at":"2024-06-18T21:26:06.348Z","dependency_job_id":null,"html_url":"https://github.com/seatgeek/docker-mirror","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seatgeek%2Fdocker-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seatgeek%2Fdocker-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seatgeek%2Fdocker-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seatgeek%2Fdocker-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seatgeek","download_url":"https://codeload.github.com/seatgeek/docker-mirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238343319,"owners_count":19456204,"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":["docker","mirror"],"created_at":"2025-02-11T18:14:56.622Z","updated_at":"2025-10-26T14:30:43.041Z","avatar_url":"https://github.com/seatgeek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-mirror\n\n[![build](https://github.com/seatgeek/docker-mirror/actions/workflows/build.yml/badge.svg)](https://github.com/seatgeek/docker-mirror/actions/workflows/build.yml)\n\nThis project will copy public DockerHub, Quay or GCR repositories to a private registry.\n\n\u003c!-- TOC --\u003e\n\n- [docker-mirror](#docker-mirror)\n  - [Install / Building](#install--building)\n  - [Using](#using)\n    - [Adding new mirror repository](#adding-new-mirror-repository)\n    - [Updating / resync an existing repository](#updating--resync-an-existing-repository)\n    - [Update all repositories](#update-all-repositories)\n  - [Example config.yaml](#example-configyaml)\n  - [Environment Variables](#environment-variables)\n\n\u003c!-- /TOC --\u003e\n\n## Install / Building\n\n- make sure you got Go 1.15 or newer\n  - OSX: `brew install go`\n- make sure you have `CGO` enabled\n  - `export CGO_ENABLED=1`\n- clone this repository to `$HOME/src/github.com/seatgeek/docker-mirror`\n- change your working directory to `$HOME/go/src/github.com/seatgeek/docker-mirror`\n- run `go install` to build and install the `docker-mirror` binary into your `$HOME/go/bin/` directory\n  - alternative: `go build` to build the binary and put it in the current working directory\n\n## Using\n\nMake sure that your local Docker agent is logged into to `ECR`.\n- To login to ECR private registries: \\\n`aws ecr get-login-password --region us-east-1 | docker login -u AWS --password-stdin ACCOUNT_ID.dkr.REGION.amazonaws.com`\n- To login to ECR public registries: \\\n`aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/YOUR_ECR_PUBLIC_SUFFIX` \\\n  Note that the region must be `us-east-1` for ECR public registry authentication.\n  \n_See [AWS ECR documentation](https://docs.aws.amazon.com/ecr/index.html) for more details_\n\n`docker-mirror` will automatically create the ECR repository on demand, so you do not need to login and do any UI operations in the AWS Console.\n\n`docker-mirror` will look for your AWS credentials in all the default locations (`env`, `~/.aws/` and so forth like normal AWS tools do)\n\n### Configuration File\n\nThere are several configuration options you can use in your `config.yaml` below. Please see the `config.yaml` file in the repository for a full example.\n\n- `ignore_tag:` This option sets tags that can be ignored on pulls. (i.e. `ignore_tag: - \"*-alpine\"`)\n\n- `match_tag:` This option sets the tags that you want to match on for pulls. (i.e. `match_tag: - \"3*\"`)\n\n- `max_tag_age:` This option sets the max tag age you wish to pull from. (i.e. `max_tag_age: 4w`)\n\n- `name:` This option sets the name of your repository. (i.e. `name: elasticsearch`)\n\n- `host:` This options sets where do you want to mirror repositories from. Accepted values include `hub.docker.com`, `quay.io` and `gcr.io`. If not set, images will be pulled from Docker Hub.\n\n- `private_registry:` This option allows you to set a private Docker registry prefix for docker pulls. It will prefix any of your `name:` options with the `private_registry` name and a slash to allow you to customize where your images are being pulled through. This is particularly useful if you use a proxy to dockerhub. i.e. (`private_registry: \"private-registry-name\"`)\n\n### Adding new mirror repository\n\n- add the new repository to the `config.yaml` file\n  - TIP: omit the `max_tag_age` for the initial sync to mirror all historic tags (`match_tag` is fine to use in all cases)\n- run `PREFIX=${reopsitory_name} docker-mirror` to trigger a sync for the specific new repository (you probably don't want to sync all the existing repositories)\n- add the `max_tag_age` filter to the newly added repository so future syns won't cosider all historic tags\n\n### Updating / resync an existing repository\n\n- run `PREFIX=${reopsitory_name} docker-mirror` to trigger a sync for the specific repository\n  - TIP: Consider if the tags you want to sync fits within the `max_tag_age` and other filters\n\n### Update all repositories\n\n- run `docker-mirror` and wait (for a while)\n\n## Example config.yaml\n\n```yml\n---\ncleanup: true # (optional) Clean the mirrored images (default: false)\ntarget:\n  # where to copy images to\n  # Below is an example of the ECR private registry.\n  # To mirror repositories to a ECR public registry, replace this value with public.ecr.aws/YOUR_ECR_PUBLIC_ALIAS\n  registry: ACCOUNT_ID.dkr.REGION.amazonaws.com\n\n  # (optional) prefix all repositories with this name\n  # ACCOUNT_ID.dkr.REGION.amazonaws.com/hub/jippi/hashi-ui\n  prefix: \"hub/\"\n\n# what repositories to copy\nrepositories:\n    # will automatically know it's a \"library\" repository in dockerhub\n  - name: elasticsearch\n    match_tag: # tags to match, can be specific or glob pattern\n      - \"5.6.8\" # specific tag match\n      - \"6.*\"   # glob patterns will match\n    ignore_tag: # tags to never match on (even if its matched by `tag`)\n      - \"*-alpine\" # support both glob or specific strings\n\n  - name: yotpo/resec\n    host: hub.docker.com # mirror the repository from Docker Hub\n    max_tag_age: 8w # only import tags that are 8w or less old\n\n  - name: jippi/hashi-ui\n    max_tags: 10 # only copy the 10 latest tags\n    match_tag:\n      - \"v*\"\n        \n  - name: kubebuilder/kube-rbac-proxy\n    host: gcr.io # mirror the repository from Google Container Registry \n\n  - name: jippi/go-metadataproxy # import all tags\n```\n\n## Environment Variables\n\nEnvironment Variable  |  Default       | Description\n----------------------| ---------------| -------------------------------------------------\nCONFIG_FILE           | config.yaml    | config file to use\nDOCKERHUB_USER        | unset          | optional user to authenticate to docker hub with\nDOCKERHUB_PASSWORD    | unset          | optional password to authenticate to docker hub with\nLOG_LEVEL             | unset          | optional control the log level output\nPREFIX                | unset          | optional only mirror images that match the defined prefix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseatgeek%2Fdocker-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseatgeek%2Fdocker-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseatgeek%2Fdocker-mirror/lists"}