imgpkg

module
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2024 License: Apache-2.0

README

logo

OpenSSF Best Practices

imgpkg

imgpkg (pronounced: "image package") is a tool that allows users to store a set of arbitrary files as an OCI image. One of the driving use cases is to store Kubernetes configuration (plain YAML, ytt templates, Helm templates, etc.) in OCI registry as an image.

imgpkg's primary concept is a bundle, which is an OCI image that holds 0+ arbitrary files and 0+ references to dependent OCI images. With this concept, imgpkg is able to copy bundles and their dependent images across registries (both online and offline).

$ imgpkg push -b your-user/app1-config:0.1.1 -f config/
$ imgpkg copy -b your-user/app1-config:0.1.1 --to-repo other-user/app1
$ imgpkg pull -b your-user/app1-config:0.1.1 -o /tmp/app1-config
$ imgpkg tag ls -i your-user/app1-config

Features:

  • Allows to push a bundle containing a set of files, and a list of images on which they depend
  • Allows to pull a bundle and extract the same set of files and list of image references
  • Allows to copy a bundle thickly (i.e. bundle image + all referenced images) to a repo or tarball
  • Air-gapped environment support via copy command
  • Allows to list pushed image tags
  • Uses Docker layer media type to work with existing registries
  • Uses deterministic file permissions and timestamps to make images reproducable (same digest if nothing changed)
Join the Community and Make Carvel Better

Carvel is better because of our contributors and maintainers. It is because of you that we can bring great software to the community. Please join us during our online community meetings. Details can be found on our Carvel website.

You can chat with us on Kubernetes Slack in the #carvel channel and follow us on Twitter at @carvel_dev.

Check out which organizations are using and contributing to Carvel: Adopter's list

Development

Build the code with

./hack/build.sh

Testing

Run every test with a local registry (requires Docker)

./hack/test-all-local-registry.sh 5000

If you would like to use a proxy registry for pulling images in order to avoid rate limiting from dockerhub, set DOCKERHUB_PROXY environment variable to that proxy, e.g.:

export DOCKERHUB_PROXY=<my-registry.local.sometld/my-dockerhub-proxy> && ./hack/test-all-local-registry.sh 5000
Source Code Changes

To keep source code documentation up to date, imgpkg uses godoc. To document a type, variable, constant, function, or a package, write a regular comment directly preceding its declaration that begins with the name of the element it describes. See the registry package for an example. When contributing new source code via a PR, the GitHub Action linter will ensure that godocs are included in the changes.

To view the docs

  1. install godoc: go install golang.org/x/tools/cmd/godoc@latest
  2. Start the server: godoc -http=:6060 and visit http://localhost:6060/pkg/carvel.dev/imgpkg/.

Directories

Path Synopsis
cmd
pkg
imgpkg/bundle/bundlefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
imgpkg/cmd
Package cmd contains mechanism of tying the cli interactions such as commands and flags to business logic layers
Package cmd contains mechanism of tying the cli interactions such as commands and flags to business logic layers
imgpkg/imagedesc
Package imagedesc defines the description of image, indexes and layers used by go-containerregistry
Package imagedesc defines the description of image, indexes and layers used by go-containerregistry
imgpkg/imagedigest
Package imagedigest utility packages to abstract the retrieval of Digests
Package imagedigest utility packages to abstract the retrieval of Digests
imgpkg/imageutils/verify
Package verify provides a ReadCloser that verifies content matches the expected hash values.
Package verify provides a ReadCloser that verifies content matches the expected hash values.
imgpkg/internal/util
Package util contains internal utility tools used in imgpkg
Package util contains internal utility tools used in imgpkg
imgpkg/registry
Package registry provides facilities for reading/writing v1.Images,Indexes from/to a remote image registry.
Package registry provides facilities for reading/writing v1.Images,Indexes from/to a remote image registry.
imgpkg/registry/auth
Package auth provides different keychains used in imgpkg
Package auth provides different keychains used in imgpkg
imgpkg/registry/auth/credentialprovider
Package credentialprovider contains helper functions used in auth package
Package credentialprovider contains helper functions used in auth package
imgpkg/registry/registryfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
imgpkg/signature/signaturefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
imgpkg/v1
Package v1 contains the public API version 1 used by other tools to interact with imgpkg
Package v1 contains the public API version 1 used by other tools to interact with imgpkg
test
helpers/registry
Package registry implements a docker V2 registry and the OCI distribution specification.
Package registry implements a docker V2 registry and the OCI distribution specification.
helpers/registry/httptest
Package httptest provides a method for testing a TLS server a la net/http/httptest.
Package httptest provides a method for testing a TLS server a la net/http/httptest.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL