Copy an image
Why Copy an Image?
Copying container images from external registries into the Katapult Container Registry comes with several benefits:
- Zero bandwidth charges: when an image is in the Katapult Container Registry it incurs no bandwidth charges when used in the Katapult ecosystem, reducing your overall costs.
- Improved performance: storing images in KCR improves pull speeds and performance when deploying within the Katapult ecosystem.
- Unified billing: simplify your accounting with all container registry usage appearing in your Katapult invoice.
- Fewer external dependencies: reduce reliance on third-party registries and avoid surprises from outages or policy changes.
- Simplified access management: manage permissions for all your container images in one place through Katapult.
Skopeo
skopeo is a command-line utility for managing container images across registries. that enables seamless interactions with container images and registries. It allows you to:
- Copy images between different storage mechanisms and container registries
- Inspect container images without pulling the full image
Why Use skopeo
for Image Copying?
- Efficiency: Directly transfers images between registries without needing local storage
- Flexibility: Supports multiple registry formats (Docker, OCI, local directories)
- Simplicity: Streamlines what would otherwise be a multi-step process
The example below demonstrates copying an Ubuntu image from Docker Hub to your Katapult Container Registry:
skopeo copy docker://docker.io/library/ubuntu:latest docker://kcr.io/<your-org>/ubuntu:latest
The following example outlines the command structure for copying a Docker image from another registry to KCR:
skopeo copy docker://<source-registry>/<source-image-name>:<tag> docker://kcr.io/<you-org>/<destination-image-name>:<tag>
Docker Pull and Push
Another common approach for copying container images between registries is using Docker's native pull
and push
commands.
How to Copy an Image with Docker
-
First, pull the image you want to copy from its source registry:
docker pull <source-registry>/<source-image-name>:<tag>
-
Tag the pulled image with your Katapult Container Registry destination:
docker tag <source-registry>/<source-image-name>:<tag> kcr.io/<your-org>/<destination-image-name>:<tag>
-
Push the image to your Katapult Container Registry:
docker push kcr.io/<your-org>/<destination-image-name>:<tag>
Example
# Pull the Ubuntu image from Docker Hub
docker pull docker.io/library/ubuntu:latest
# Tag it for your KCR repository
docker tag docker.io/library/ubuntu:latest kcr.io/<your-org>/ubuntu:latest
# Push to KCR
docker push kcr.io/<your-org>/ubuntu:latest