> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pull Images from Registries

> Configure workloads to pull container images from public and private registries.

Control Plane can pull container images from any Docker-compatible registry. Public images work out of the box, while private registries require [pull secrets](https://docs.controlplane.com/reference/gvc.md#pull-secrets).

## When to use this

> [card] Private registries
>
> Pull from **Docker Hub private repos**, **Amazon Elastic Container Registry (ECR)**, **Google Container Registry (GCR)**, **Google Artifact Registry (GAR)**, **Azure Container Registry (ACR)**, or **GitHub Container Registry (GHCR)**.

> [card] Cross-org images
>
> Use images from another Control Plane organization

> [card] Enterprise registries
>
> Connect to self-hosted or enterprise container registries

> [card] Secure supply chain
>
> Control access to private images with pull secrets

## Prerequisites

> [accordion] Required permissions
>
> * `create` and `use` on [Secrets](https://docs.controlplane.com/reference/secret.md)
> * `edit` on [GVC](https://docs.controlplane.com/reference/gvc.md)
> * `edit` or `create` on [Workload](https://docs.controlplane.com/reference/workload)

> [accordion] CLI installed (optional)
>
> The CLI is optional but helpful. See [Installation](https://docs.controlplane.com/cli-reference/installation.md).

## Pull from public registries

Public images do not require pull secrets. Use these formats:

| Registry | Format |
| - | - |
| Docker Hub | `IMAGE_NAME:TAG` |
| Amazon ECR Public | `public.ecr.aws/REGISTRY-ALIAS/IMAGE:TAG` |
| Google Artifact Registry | `LOCATION-docker.pkg.dev/PROJECT/REPO/IMAGE:TAG` |
| GitHub Container Registry | `ghcr.io/OWNER/IMAGE:TAG` |

## Pull from private registries

**1. Create a pull secret**

> [tab] Console
>
> 1. Navigate to **Secrets** in the left menu.
> 2. Click **New** or use the **Create** dropdown.
> 3. Enter a name for the secret.
> 4. Select the secret type:
>    * [**Docker**](https://docs.controlplane.com/guides/create-secret/docker.md) for Docker Hub, Azure Container Registry, Google Artifact Registry, GitHub Container Registry, or another Control Plane org
>    * [**ECR**](https://docs.controlplane.com/guides/create-secret/ecr.md) for Amazon ECR
>    * [**GCP**](https://docs.controlplane.com/guides/create-secret/gcp.md) for Google Container Registry
> 5. Click `Data`, then enter the credentials.
> 6. Click **Create**.

> [tab] CLI
>
> For Docker Hub or compatible registries:
>
> ```bash theme={null}
> cpln secret create-docker --name my-docker-secret \
>   --file /path/to/auths.json
> ```
>
> For Amazon ECR:
>
> ```bash theme={null}
> cpln secret create-ecr --name my-ecr-secret \
>   --access-key AKIAXXXXXXXX \
>   --secret-key xxxxxxxxxxxxx \
>   --repo AWS_ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/REPO_NAME \
>   --role-arn arn:aws:iam::123456789:role/ecr-role
> ```
>
> For GCP:
>
> ```bash theme={null}
> cpln secret create-gcp --name my-gcp-secret \
>   --file /path/to/service-account.json
> ```

> [!NOTE]
>
> Images from your own org’s Control Plane registry do not need a pull secret.

**2. Associate with a GVC**

> [tab] Console
>
> 1. Navigate to your GVC.
> 2. Click **Pull Secrets**.
> 3. Click **Add Pull Secret**, select your secret, and click `OK`.
> 4. Click **Update**.

> [tab] CLI
>
> ```bash theme={null}
> cpln gvc update my-gvc --set spec.pullSecretLinks+=SECRET_NAME
> ```

**3. Configure your workload**

Reference the image in your workload using the appropriate format:

| Registry | Image Format |
| - | - |
| Control Plane (same org) | `//image/IMAGE:TAG` |
| Control Plane (cross-org) | `ORG.registry.cpln.io/IMAGE:TAG` |
| Docker Hub | `IMAGE:TAG` |
| Amazon ECR | `ACCOUNT.dkr.ecr.REGION.amazonaws.com/IMAGE:TAG` |
| Azure Container Registry | `REGISTRY.azurecr.io/IMAGE:TAG` |
| Google Container Registry | `gcr.io/PROJECT/IMAGE:TAG` |
| GitHub Container Registry | `ghcr.io/OWNER/IMAGE:TAG` |

## Pull from Control Plane registry

### Same organization

No pull secret is needed:

```yaml theme={null}
containers:
  - name: my-container
    image: //image/my-app:v1
```

### Cross-organization

1. [Create a Docker secret](https://docs.controlplane.com/reference/secret.md#control-plane) with the other org’s credentials.
2. Add it as a pull secret to your GVC.
3. Reference the image:

```yaml theme={null}
containers:
  - name: my-container
    image: other-org.registry.cpln.io/my-app:v1
```

## Troubleshooting

> [accordion] Authentication failed
>
> 1. Verify the secret credentials are correct.
> 2. Check the secret is associated with the GVC.
> 3. Ensure the secret type matches your registry.

> [accordion] Image not found
>
> Verify the image name and tag are correct. Check the registry for the exact image path.

> [accordion] Cross-org pull fails
>
> * Ensure the source org has granted access and your Docker secret has the correct credentials.
> * Learn more about [configuring a secret](https://docs.controlplane.com/reference/secret.md#control-plane) for pulling images from other Control Plane orgs.

## Next steps

> [card] [Push Images](https://docs.controlplane.com/guides/push-image.md)
>
> Push images to Control Plane registry

> [card] [Copy Images](https://docs.controlplane.com/guides/copy-image.md)
>
> Copy images between organizations

> [card] [Create a Workload](https://docs.controlplane.com/guides/create-workload.md)
>
> Deploy containers with your images

> [card] [Secrets Reference](https://docs.controlplane.com/reference/secret.md)
>
> Learn about secret types
