sinker
syncs container images from one registry to another. This is useful in cases when you rely on images that exist in a public container registry, but need to pull from a private registry.
See the example folder for more details on the produced files.
GO111MODULE=on go get github.com/plexsystems/sinker
Releases are also provided in the releases tab on GitHub.
While the create
and update
commands assist with managing the image manifest, the push
command will not modify the image manifest. Allowing you to manually control the manifest if desired.
target:
host: mycompany.com
repository: myteam
The target
section is where the images will be synced to. The above yaml would sync all images to the myteam
repository hosted at mycompany.com
(mycompany.com/myteam/...
)
target:
host: mycompany.com
repository: myteam
sources:
- repository: coreos/prometheus-operator
host: quay.io
tag: v0.40.0
- repository: super/secret
tag: v0.3.0
auth:
username: DOCKER_USER_ENV
password: DOCKER_PASSWORD_ENV
- repository: nginx
digest: sha256:bbda10abb0b7dc57cfaab5d70ae55bd5aedfa3271686bace9818bba84cd22c29
The images section includes the host of the registry and the repository where the image is located. For example, the prometheus-operator
would be pushed to:
mycompany.com/myteam/coreos/prometheus-operator:v0.40.0
When using digests
, the image will be pushed with a tag matching the SHA of the digest:
mycompany.com/myteam/nginx:bbda10abb0b7dc57cfaab5d70ae55bd5aedfa3271686bace9818bba84cd22c29
In both the target
and sources
section, the host
field is optional. When no host is set, the host is assumed to be Docker Hub (docker.io
).
All auth is handled by looking at the clients Docker auth. If the client can perform a docker push
or docker pull
, sinker will be able to as well.
In the event that an image that needs to be sync'd is in another registry, the auth
section allows you to set the names of environment variables that will be used for creating basic auth to the registry. This is useful in CI pipelines.
Descriptions of commands and flags to help understand how to use Sinker.
Set the directory or location of the manifest file to read from. Defaults to .images.yaml
in the working directory.
Push all of the images inside of the image manifest to the target registry.
$ sinker push
The --dryrun
flag will print out a summary of the images that do not exist at the target registry and the fully qualified names of the images that will be pushed.
Pulls the source or target images found in the image manifest.
Pulling the source
could be useful if you want to perform additional actions on the image(s) before performing a push operation (e.g. scanning for vulnerabilities).
Pulling the target
could be useful if you need to load the images into another environment, such as Kind.
$ sinker pull <source|target>
Prints a list of either the source
or target
images that exist in the image manifest. This can be useful for piping into additional tooling that acts on image urls.
$ sinker list <source|target>
Outputs the list to a file (e.g. source-images.txt
).
Checks if any of the source images found in the image manifest have new updates.
$ sinker check
A list of images to check updates for delimeted by commas, e.g.
$ sinker check --images jimmidyson/configmap-reload:v0.3.0,quay.io/coreos/prometheus-config-reloader:v0.39.0
Create an image manifest that will sync images to the given target registry.
$ sinker create <file|directory> --target mycompany.com/myteam
Specifies the target registry (and optionally a repository) to sync the images to.
Find all image references in the file or directory that was passed in.
While this tool is not Kubernetes specific, currently the create
and update
commands can take a file or directory to find all Kubernetes manifests and extract the image references from them. This includes images specified in container arguments as well as CRDs such as Prometheus
and Alertmanager
.
The intent is that this can be expanded to support other workloads (e.g docker compose).
$ sinker create example/bundle.yaml --target mycompany.com/myteam
target:
host: mycompany.com
repository: myteam
sources:
- repository: coreos/prometheus-operator
host: quay.io
tag: v0.40.0
- repository: jimmidyson/configmap-reload
tag: v0.3.0
- repository: coreos/prometheus-config-reloader
host: quay.io
tag: v0.40.0
Updates the current image manifest to reflect new changes found in the Kubernetes manifest(s).
$ sinker update <file|directory>
NOTE: The update command will ONLY update image versions. This allows for pinning of certain fields you want to manage yourself (source registry, auth).