The DigitalOcean Container Registry (DOCR) is a private Docker image registry that lets you store and manage private container images. DOCR integrates natively with Docker environments and DigitalOcean Kubernetes clusters.
To create a registry in the control panel:
To create a registry using the command-line:
doctl
and authenticate it with an API token.registry create
command to create your registry:doctl registry create <my-registry-name> --region <region>
To push a Docker image to your registry:
Use the registry login
command to authenticate Docker with your registry:
doctl registry login
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>
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.
Because image manifests are cached across different regions, pushing an image to an already-existing tag may take up to one hour to update in other regions’ caches. To avoid this delay, you can:
:latest
tag, which is intentionally never cached (as it is usually updated frequently).To create containers from the images stored in your registry from the control panel:
The default service account in each of those namespaces is updated to include the secret in its image pull secret.
Visit the Apps page.
Click Create App if starting from scratch, or click an existing app to add your container image to it.
Select DigitalOcean Container Registry as the source for your code, choose the image you would like to use from the Repository drop-down, and select the tag of the image you would like to deploy.
Configure resources for your app.
Click Next.
If you want to use resource- and app-level environment variables, on the Environment page, click Edit to supply them. Click the Encrypt checkbox to ensure a variable’s value is encrypted in the App Spec. Click Next.
If you want to change the default name or project for your app, or choose the region where you would like your app to be hosted, click Edit on the Info page. Click Save and then click Next.
Review your app’s resources, environment variables and billing information on the Review page and then click Create Resources.
Once your app deploys, you can view the app at the URL at the top of the app’s Overview page.
To view and delete images in your registry:
Navigate to Container Registry in the control panel.
If you have a live registry and you have pushed images to it, they will be listed.
Click the plus, +, next to each repository to see its image versions and each version’s tags. You can also see untagged images here, which we recommend deleting through garbage collection.
Choose whether to delete digests or tags:
To delete digests, click the … menu to the right of an image version and select Delete Digest. Enter your registry name and click Delete to confirm.
Deleting digests also deletes their associated tags.
To delete tags, click the … menu to the right of an image version and select Delete Tags. Enter your registry name and click Delete to confirm.
Deleting an image by its tag or manifest does not delete the image layers. We recommend running garbage collection to automatically delete these image layers and all untagged manifests.
To delete your registry using the control panel:
To delete your registry on the command-line, use the registry delete
command:
doctl registry delete