The imgpkg copy command allows you to move bundles or images between different locations, such as from a registry to a local tarball, or from one registry to another.
Common Tasks
Copy a bundle to a local tarball:
Use the -b (or --bundle) flag to specify the source bundle and --to-tar to specify the destination file.
Copy a bundle to another registry:
Use the -b flag for the source and --to-repo for the destination repository.
Copy an image to another registry:
Use the -i (or --image) flag for the source and --to-repo for the destination repository.
Shallow-copy a bundle image:
If you want to copy an image that is actually a bundle without performing a full bundle check, use the --ignore-bundle-check flag with the -i flag.
Use repository-based tags:
When copying images, you can use the --repo-based-tags flag. This allows imgpkg to generate new tags in the destination repository based on the source repository's structure. For example, if a source tag is a SHA digest, the new tag will be a truncated version of that digest prefixed by the application name.
# Copy bundle dkalinin/app1-bundle to local tarball at /Volumes/app1-bundle.tar
imgpkg copy -b dkalinin/app1-bundle --to-tar /Volumes/app1-bundle.tar
# Copy bundle dkalinin/app1-bundle to another registry
imgpkg copy -b dkalinin/app1-bundle --to-repo internal-registry/app1-bundle
# Copy image dkalinin/app1-image to another registry
imgpkg copy -i dkalinin/app1-image --to-repo internal-registry/app1-image
# Copy using image --repo-based-tags flag
imgpkg copy -i registry.foo.bar/some/application/app --to-repo other-reg.faz.baz/my-app --repo-based-tags