The script in this directory, imagesync.py
is used to both manage and transfer images from external registries (such as registry1, docker, quay, etc.)
to the registry specified in the destination.registry
key of ecr.yaml
.
There are two main functions this script provides:
- tidy: The
tidy
command will consume theecr.yaml
file specified with the-f
flag and locate images that are either unused or missing from it. - sync: The
sync
command syncs the images in theimages
key ofecr.yaml
to the registry specified bydestination.registry
(or the--registry
flag, if passed)
The Dockerfile in this directory will create an image that has imagesync.py and all its dependencies available.
To build the an image that is runnable on the architecture of your machine, execute the following command:
make build
To build the an image that is runnable on an ARM64 machine, execute the following command:
ARCH=arm64 make build
or for amd64
ARCH=amd64 make build
The following sections describe how imagesync can be run using one of two methods:
- Using the image built by the
Build
section of this README - Using the script directly
If you are running WSL it is recommended that you download and setupdocker desktop wsl2 backend and setup your folder structure on windows as:
C:\Users\{USER}\.docker
and on your WSL distro:
/home/{USER}/.docker
If you wish to use the image built by commands in the Build
section of this README, you can run the following command:
docker run \
-v ${HOME}/.docker/:/root/.docker/ \
-v ${HOME}/.kube/config:/root/.kube/config \
-v ${PWD}/images.yaml:/app/images.yaml \
--rm imagesync:latest \
-f /app/images.yaml \
--help