hagrid-sync
This repo is ripped from skopeo with the following key differences:
- CLI re-written using Cobra/Viper
- Completely unique config file:
config.yaml
- Many legacy features removed
- Many features removed
With the intent of scoping the functionality to only the following:
- Syncing images defined in Kubernetes manifests to Docker registries
- Statically compiling (no external clibs)
Given the scope of hagrid-sync
, it's primary use case is transporting images across an air gap, where the images may come from existing registries, or defined through Kubernetes manifests.
Syncing
hagrid-sync
scopes the syncing capability around the concept of declaritively defined images. Images to sync can be defined via:
- explicitly defined images in
config.yaml
under source.images[]
- images parsed from kubernetes manifests defined in
config.yaml
under source.manifests[]
The intent of scoping syncing to only the above use cases is to scope hagrid-sync
to packaging images obtained from kubernetes manifests for transport.
hagrid-sync
provides 2 methods of syncing:
Pull
Pulling is intended to be the "packaging" step of hagrid-sync
. It is used to sync images defined through the hagrid-sync
config file (explicit images and kubernetes manifests) to a local transient registry. The local transient registry can then be zipped up and transferred over an air gap to later be synchronized using the hagrid-sync push
command.
Push
Pushing is intended to be the "unpackaging" step of hagrid-sync. It is used to sync images packaged in a transient registry (from the hagrid-sync pull
step) to a generic registry.
Examples
The below walks through several example use cases, and assumes docker as a container runtime.
NOTE: Requires that hagrid-sync
is built, you can build hagrid-sync
for the current OS you're on with make build
in the root directory of this project.
# Start local registry
docker run -p 5000:5000 -v `pwd`/registry:/var/lib/registry registry:latest
# Sync images defined in kubernetes manifests to a local transient registry
bin/hagrid-sync pull
# Sync images defined in kubernetes manifests located in transient registry to remote registry
docker run -p 5001:5000 registry:latest
bin/hagrid-sync push