All Projects → seatgeek → Docker Mirror

seatgeek / Docker Mirror

Licence: bsd-3-clause
Mirror docker images across image repositories

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Docker Mirror

Mirror
A blogging tool powered by GitHub API. Write your blog on GitHub issue.
Stars: ✭ 590 (+719.44%)
Mutual labels:  mirror
Local Npm
Local and offline-first npm mirror
Stars: ✭ 1,040 (+1344.44%)
Mutual labels:  mirror
Pkgmirror
Packages Mirroring
Stars: ✭ 62 (-13.89%)
Mutual labels:  mirror
Magento Mirror
Magento Mirror
Stars: ✭ 655 (+809.72%)
Mutual labels:  mirror
Zeit
Qt frontend to at & crontab CLI utilities
Stars: ✭ 42 (-41.67%)
Mutual labels:  mirror
Homemirror
Web based home mirror, inspired by Hannah Mitt's project.
Stars: ✭ 49 (-31.94%)
Mutual labels:  mirror
Python Aria Mirror Bot
A telegram bot for all your mirror needs
Stars: ✭ 383 (+431.94%)
Mutual labels:  mirror
Git Mirror
A small utility that allows to mirror external repositories to GitLab, GitHub and possible more.
Stars: ✭ 66 (-8.33%)
Mutual labels:  mirror
Netrw
Mirror of Dr. Chip's netrw vim plugin for vundle
Stars: ✭ 44 (-38.89%)
Mutual labels:  mirror
Xn resource editor
💫 Unofficial mirror of XN Resource Editor v3.0.0.1.
Stars: ✭ 61 (-15.28%)
Mutual labels:  mirror
Mirror Textfiles.com
TextFiles.com mirror
Stars: ✭ 23 (-68.06%)
Mutual labels:  mirror
Cpcache
central pacman cache
Stars: ✭ 15 (-79.17%)
Mutual labels:  mirror
Repo Lockdown
GitHub Action that immediately closes and locks issues and pull requests
Stars: ✭ 56 (-22.22%)
Mutual labels:  mirror
Composer Mirror
Composer 全量镜像发布于2017年3月,曾不间断运行2年多。这个开源有助于理解 Composer 镜像的工作原理
Stars: ✭ 607 (+743.06%)
Mutual labels:  mirror
Packagist Mirror
Alibaba Cloud Packagist Mirror
Stars: ✭ 63 (-12.5%)
Mutual labels:  mirror
Composer Registry Manager
🛠 🔨 Composer registry manager that help to easily switch to the composer repository you want.
Stars: ✭ 448 (+522.22%)
Mutual labels:  mirror
Angelscript Mirror
Unofficial mirror for Angelscript's SVN repository, updated hourly.
Stars: ✭ 49 (-31.94%)
Mutual labels:  mirror
Hjmirror
Mirroring you droid device screen to Windows, MacOS and Linux.
Stars: ✭ 67 (-6.94%)
Mutual labels:  mirror
Aircast Ios
aircast iOS SDK --- airplay screen mirror receiver iOS8-iOS11.3 support
Stars: ✭ 64 (-11.11%)
Mutual labels:  mirror
Templeos
Talk to God on up to 64 cores. Final snapshot of the Third Temple.
Stars: ✭ 1,089 (+1412.5%)
Mutual labels:  mirror

docker-mirror

This project will copy public DockerHub repositories to a private registry.

It's possible to filter by docker tags, tag age and number of latest tags.

Install / Building

  • make sure you got Go 1.15 or newer
    • OSX: brew install go
  • make sure you have CGO enabled
    • export CGO_ENABLED=1
  • clone this repository to $HOME/src/github.com/seatgeek/docker-mirror
  • change your working directory to $HOME/go/src/github.com/seatgeek/docker-mirror
  • run go install to build and install the docker-mirror binary into your $HOME/go/bin/ directory
    • alternative: go build to build the binary and put it in the current working directory

Using

Make sure that your local Docker agent is logged into to ECR (aws ecr get-login-password --region us-east-1 | docker login -u AWS --password-stdin ACCOUNT_ID.dkr.REGION.amazonaws.com)

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.

docker-mirror will look for your AWS credentials in all the default locations (env, ~/.aws/ and so forth like normal AWS tools do)

Adding new mirror repository

  • add the new repository to the config.yaml file
    • TIP: omit the max_tag_age for the initial sync to mirror all historic tags (match_tag is fine to use in all cases)
  • 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)
  • add the max_tag_age filter to the newly added repository so future syns won't cosider all historic tags

Updating / resync an existing repository

  • run PREFIX=${reopsitory_name} docker-mirror to trigger a sync for the specific repository
    • TIP: Consider if the tags you want to sync fits within the max_tag_age and other filters

Update all repositories

  • run docker-mirror and wait (for a while)

Example config.yaml

---
cleanup: true # (optional) Clean the mirrored images (default: false)
target:
  # where to copy images to
  registry: ACCOUNT_ID.dkr.REGION.amazonaws.com

  # (optional) prefix all repositories with this name
  # ACCOUNT_ID.dkr.REGION.amazonaws.com/hub/jippi/hashi-ui
  prefix: "hub/"

# what repositories to copy
repositories:
    # will automatically know it's a "library" repository in dockerhub
  - name: elasticsearch
    match_tag: # tags to match, can be specific or glob pattern
      - "5.6.8" # specific tag match
      - "6.*"   # glob patterns will match
    ignore_tag: # tags to never match on (even if its matched by `tag`)
      - "*-alpine" # support both glob or specific strings

  - name: yotpo/resec
    max_tag_age: 8w # only import tags that are 8w or less old

  - name: jippi/hashi-ui
    max_tags: 10 # only copy the 10 latest tags
    match_tag:
      - "v*"

  - name: jippi/go-metadataproxy # import all tags

Environment Variables

Environment Variable Default Description
CONFIG_FILE config.yaml config file to use
DOCKERHUB_USER unset optional user to authenticate to docker hub with
DOCKERHUB_PASSWORD unset optional password to authenticate to docker hub with
LOG_LEVEL unset optional control the log level output
PREFIX unset optional only mirror images that match the defined prefix
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].