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 p8kr, 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.
p8kr 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 p8kr to packaging images obtained from kubernetes manifests for transport.
p8kr provides 2 methods of syncing:
Pulling is intended to be the “packaging” step of p8kr. It is used to sync images defined through the p8kr 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 p8kr push command.
Pushing is intended to be the “unpackaging” step of p8kr. It is used to sync images packaged in a transient registry (from the p8kr pull step) to a generic registry.
The below walks through several example use cases, and assumes docker as a container runtime.
NOTE: Requires that p8kr is built, you can build p8kr 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
# Sync images defined in kubernetes manifests located in transient registry to remote registry
docker run -p 5001:5000 registry:latest