Interact with the Container Registry: Docker, Crane and API
Last updated on
STACKIT Container Registry is built upon the official, OCI-compliant distribution image maintained by the Docker team. Because it strictly follows Open Container Initiative (OCI) specifications, you can interact with your STACKIT registry using standard Docker commands, CI/CD integrations, API calls, or any other OCI-compatible client tooling.
Below are examples of how to interact with your registry using some of the most common methods.
Usage of the Docker CLI
Section titled “Usage of the Docker CLI”The standard Docker CLI is the most common way to authenticate, push, and pull images.
Authentication
Section titled “Authentication”Before interacting with your registry, you must authenticate. You can use your STACKIT user credentials or a project-specific Robot Account.
docker login <registry-domain>(You will be prompted to enter your username and password/token).
Pushing an image
Section titled “Pushing an image”To push a local image to your Container Registry, you first need to tag it with your registry domain and project name.
# 1. Tag the local imagedocker tag my-local-image:latest <registry-domain>/<project-name>/my-local-image:v1.0.0
# 2. Push the image to STACKITdocker push <registry-domain>/<project-name>/my-local-image:v1.0.0Pulling an image
Section titled “Pulling an image”To pull an image from your registry to your local machine or server:
docker pull <registry-domain>/<project-name>/my-local-image:v1.0.0How-to use Crane (and robot account constraints)
Section titled “How-to use Crane (and robot account constraints)”Crane is a powerful tool by Google designed specifically for interacting with remote images and registries without needing the Docker daemon.
Basic Crane commands
Section titled “Basic Crane commands”You can use crane to easily tag or copy images entirely server-side:
# Authenticatecrane auth login <registry-domain> -u <username> -p <password-or-token>
# Tag an existing image in the registrycrane tag <registry-domain>/<project-name>/my-app:v1.0.0 v1.0.1
# Inspect an image manifestcrane manifest <registry-domain>/<project-name>/my-app:v1.0.0Important Constraint: Crane and robot accounts
Section titled “Important Constraint: Crane and robot accounts”Tools like crane are frequently used in automation pipelines to manage images across multiple projects or registries simultaneously (for example, copying an image from a staging project to a production project).
Please be aware of the following limitation: Currently, STACKIT Container Registry Robot Accounts are strictly limited to a “one project scope.”
If you attempt to use a single Robot Account with crane (or any other tool) to operate across more than one Harbor project at the same time, the operation will fail with an authorization error. For cross-project automation, you must either use STACKIT user credentials or handle the cross-project movement in distinct steps using separate Robot Accounts for each project.
Direct API interaction
Section titled “Direct API interaction”Because STACKIT Container Registry utilizes Harbor, you can directly interact with the Harbor REST API to fetch metadata, manage repositories, or integrate with custom dashboards.
Example: Fetching repositories in a project
Section titled “Example: Fetching repositories in a project”You can use curl to query the API. To list the repositories within a specific project, use the following command (replace the placeholders with your actual data):
curl -u '<username>':'<password-or-token>' \ -X GET \ -H "Accept: application/json" \ "https://<registry-domain>/api/v2.0/projects/<project-name>/repositories"For complete API endpoints and capabilities, please refer to the official Harbor API documentation.