DigitalOcean Container Registry Quickstart

Create a Registry

To create a registry in the control panel:

  1. Visit the registry page.
  2. Enter a name for your registry. This name must be globally unique.
  3. Select your subscription plan and click Create Registry.

To create a registry using the command-line:

  1. Install doctl and authenticate it with an API token.

  2. Use the registry create command to create your registry:

    doctl registry create <my-registry-name>
    

Push to Your Registry

To push a Docker image to your registry:

  1. Install doctl and authenticate it with an API token.

  2. Use the registry login command to authenticate Docker with your registry:

    doctl registry login
    
  3. Use the docker tag command to tag your image with the fully qualified destination path:

    docker tag <my-image> registry.digitalocean.com/<my-registry>/<my-image>
    
  4. Use the docker push command to upload your image:

    docker push registry.digitalocean.com/<my-registry>/<my-image>
    

    If you push a new image using an existing tag, the tag gets updated but the old image is still accessible by its digest and takes up space in your registry. To reduce your storage usage, you can delete the untagged images and then run garbage collection.

Note
Because image manifests are cached in different regions, there may be a maximum delay of one hour between pushing to a tag that already exists in your registry and being able to pull the new image by tag. This may happen, for example, when using the :latest tag. To avoid the delay, use:

  • Unique tags (other than :latest)
  • SHA hash of the new manifest

Use Images in Your Registry with Kubernetes

To create containers from the images stored in your registry from the control panel:

  1. Visit the registry page and click the Settings tab.
  2. In the DigitalOcean Kubernetes integration section, click Edit to display the available Kubernetes clusters.
  3. Select the clusters and click Save.

The default service account in each of those namespaces is updated to include the secret in its image pull secret.

Use Images in Your Registry with App Platform

  1. Visit the Apps page and either click Create App if starting from scratch, or click an existing app to add your container image to your solution.
    • If adding an image to an existing solution, click the Components tab, then click Service, Worker, or Job.
  2. Select Container as the source for your code, and choose the image you would like to use from the Repository drop-down.
  3. On the next page, give your new component a name, and select the tag of the image you would like to deploy.
  4. Configure any details such as HTTP routes, environment variables, the run command, or the HTTP port.
  5. Select the instance size you would like to use when a container is created from the image.

Any updates to the image that matches the selected tag will automatically re-deploy the image on App Platform, unless otherwise specified.

Manage Images

To view or delete images in your registry:

  1. Navigate to Container Registry in the control panel.

    If you have a live registry and you have pushed images to your registry, they will be listed.

  2. Click the plus (+) sign next to each image to see tagged image versions

  3. Click More next to the tagged image version and select Delete. In the Delete tag dialog box:

    • Click Delete to delete the tag of the image.
    • Select the Delete associated digests checkbox and click Delete to delete the manifest of the image by its digest.

Deleting an image by its tag or manifest does not delete the image layers. If you delete the image manifest manually, you can subsequently run garbage collection to delete the image layers and free up space in your registry. Additionally, you can delete all untagged manifests when running a garbage collection. For more information, see Clean Up Container Registry.

Use the checkboxes to delete multiple image versions in bulk.

Delete Your Registry

To delete your registry using the control panel:

  1. Navigate to Container Registry in the control panel.
  2. Click the Actions drop-down, and select Destroy.

To delete your registry on the command-line, use the registry delete command:

doctl registry delete