/mirror-master

Lightweight docker image to sync 2 docker registries

Primary LanguageShellApache License 2.0Apache-2.0

Mirror Master aka Repo Syncer

Introduction

Mirror Master is a lightweight docker image that uses skopeo, to sync images between docker images registries, it supports all the registries supported by Skopeo such as GCR, Docker Hub, ECR and Quay.

If Skopeo does the job why I need this image?

That's a fair question!

Answer: Skopeo is awesome to deal with the complexity of docker manifest and authentication between registries, but not with filtering which tags you wanna sync (as you can see here the sync command does not have a --filter option), which leaves to you the burden/hassle/fun of list all tags and somehow decide what you want to ignore or not.

Mirror Master is meant to be a simple wrapper around the awesome work of Skopeo, easy to customize and use.

Default Variables

The default variables are environments variables that can be used to configure the container.

Name Description Mandatory?
images-list.txt Text File with {projectName}/{repository}/{image:tag} YES
SOURCE_REGISTRY Source Registry from where the images will be copied. YES
DEST_REGISTRY Destination Registry where the images will be copied. YES

Examples

Login to Cluster OCP Registry

cat /home/frqadmin/clusterconfigs/auth/kubeadmin-password oc login -u kubeadmin https://{Cluster API}}:6443 skopeo login -u kubeadmin -p $(oc whoami -t) {OCP Cluster Registry}

Login to Local Gitea Registry

podman login server.default.local:3000

Set Vars

export SOURCE_REGISTRY={Source Registry}/{Project} export DEST_REGISTRY{Dest}/{Project}

Execute Script

./mirror_master.sh

Authors

Stephan Kristyn / Phil Carvalho