Skip to main content

Copy an image

Why Copy an Image?​

Copying container images from external registries into the Krystal Container Registry comes with several benefits:

  • Zero bandwidth charges: when an image is in the Krystal Container Registry it incurs no bandwidth charges when used in the Krystal Cloud ecosystem, reducing your overall costs.
  • Improved performance: storing images in KCR improves pull speeds and performance when deploying within the Krystal Cloud ecosystem.
  • Unified billing: simplify your accounting with all container registry usage appearing in your Krystal Cloud 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 Krystal Cloud.

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 Krystal 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​

  1. First, pull the image you want to copy from its source registry:

    docker pull <source-registry>/<source-image-name>:<tag>
  2. Tag the pulled image with your Krystal Container Registry destination:

    docker tag <source-registry>/<source-image-name>:<tag> kcr.io/<your-org>/<destination-image-name>:<tag>
  3. Push the image to your Krystal 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