Question

How can a CICD system pull an image form a digitaloncean registry?

Posted May 19, 2020 593 views
Docker

Can a system without doctl pull an image from a DO registry? If so what is used for the username / password combination? I ask because I’d like to pull using bitbucket pipelines. Thx.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

The doctl integration is just a convenience. You can login to the registry without it. To do so, use a DigitalOcean API token for both the username and password:

docker login -u $DO_TOKEN -p $DO_TOKEN registry.digitalocean.com

Additionally, you can retrieve a .docker/config.json file that you can use with Docker using the API directly:

curl -X GET -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DO_TOKEN" \
  "https://api.digitalocean.com/v2/registry/docker-credentials 

See: https://developers.digitalocean.com/documentation/v2/#get-docker-credentials-for-container-registry

Submit an Answer