mqasimsarfraz / imagesync

A tool to copy/sync docker images between registries without docker deamon

Home Page:https://hub.docker.com/r/smqasims/imagesync/tags

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI codeql maintained pulls

imagesync

A tool to copy/sync container images in registries without a demon.

imagesync -h

NAME:
   imagesync - Sync container images in registries.

USAGE:
   imagesync [global options] command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --src value, -s value        Reference for the source container image/repository.
   --src-strict-tls             Enable strict TLS for connections to source container registry.
   --dest value, -d value       Reference for the destination container repository.
   --dest-strict-tls            Enable strict TLS for connections to destination container registry.
   --tags-pattern value         Regex pattern to select for tag to-be synced.
   --skip-tags-pattern value    Regex pattern to exclude tags.
   --skip-tags value            Comma separated list of tags to be skipped.
   --overwrite                  Use this to copy/override all the tags.
   --max-concurrent-tags value  Maximum number of tags to be synced/copied in parallel. (default: 1)
   --help, -h                   show help

Installation

Binary

You can download the binary from releases page and use it directly:

curl -L -O https://github.com/mqasimsarfraz/imagesync/releases/download/v1.2.0/imagesync_Linux_x86_64.tar.gz -o /tmp/imagesync_Linux_x86_64.tar.gz
tar -xvf /tmp/imagesync_Linux_x86_64.tar.gz
sudo mv /tmp/imagesync /usr/local/bin/

Docker

You can use the docker image to run imagesync:

docker run --rm -it  ghcr.io/mqasimsarfraz/imagesync:v1.2.0 -h

Examples

Following is a list of examples with different sources. In order to try out examples with testdata you need to start a local registry using:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Docker Archive

imagesync  -s testdata/alpine.tar -d localhost:5000/library/alpine:3

OCI Archive

imagesync  -s testdata/alpine-oci.tar -d localhost:5000/library/alpine:3

OCI layout

imagesync  -s testdata/alpine-oci -d localhost:5000/library/alpine:3

Image Tag

imagesync  -s library/alpine:3 -d localhost:5000/library/alpine:3

Entire Repository

imagesync  -s library/alpine -d localhost:5000/library/alpine

Private Registries

imagesync will respect the credentials stored in ~/.docker/config.json via docker login etc. So in case you are running it in a container you need to mount the path with credentials as:

docker run --rm -it  -v ${HOME}/.docker/config.json:/root/.docker/config.json  ghcr.io/mqasimsarfraz/imagesync:v1.2.0 -h

Multi-arch images

imagesync supports copying multi-arch images. So in case you are copying a multi-arch image it will copy all the platforms unlike docker pull/docker push approach which only copies the platform of the host.

Contributing/Dependencies

Following needs to be installed in order to compile the project locally:

fedora/centos

dnf --enablerepo=powertools install gpgme-devel
dnf install libassuan  libassuan-devel

debian/ubuntu

sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config

About

A tool to copy/sync docker images between registries without docker deamon

https://hub.docker.com/r/smqasims/imagesync/tags


Languages

Language:Go 84.1%Language:Dockerfile 9.5%Language:Shell 6.4%