DigitalOcean Container Registry Quickstart Early Availability

Create a Registry

To create a registry in the control panel:

  1. Visit the registry page under Images.
  2. Enter a name for your registry. This name must be globally unique.
  3. You will be advised if you need to enable a Spaces subscription first, which you can do by visiting the Spaces area of the control panel.

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>
    

Use Images in Your Registry with Kubernetes

To create containers from the images stored in your registry:

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

  2. Use the cluster list command to get your cluster ID:

    doctl kubernetes cluster list
    
  3. Use the kubeconfig save command to configure kubectl, the Kubernetes command-line interface, to interact with your Kubernetes cluster, by passing in the cluster ID:

    doctl kubernetes cluster kubeconfig save <my-cluster-id>
    
  4. Use the kubernetes-manifest command to store an authentication token for your registry as a secret in your cluster:

    doctl registry kubernetes-manifest | kubectl apply -f -
    
  5. Instruct the default service account to use the authentication token as an imagePullSecret. Be sure to replace <my-registry> in the name field in the below command while keeping the registry- prefix:

    kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "registry-<my-registry>"}]}'
    
  6. From now on, your DigitalOcean Kubernetes cluster will be able to use the images in your registry, like in this example deployment command:

    kubectl create deployment <my-deployment-name> --image=registry.digitalocean.com/<my-registry>/<my-image>
    

Manage Images

To view or delete images in your registry:

  1. Navigate to Images in the control panel and click on the Container Registry tab.
  2. If you have a live registry and you have pushed images to your registry, they will be listed.
  3. Click the plus (+) sign next to each image to see tagged image versions
  4. Click the More option next to the tagged image version to delete it, or use the checkboxes to delete multiple image versions in bulk.

Delete Your Registry

To delete your registry using the control panel:

  1. Navigate to Images in the control panel and click on the Container Registry tab.
  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