I've pushed a custom image to a private Digital Ocean container registry that I'd now like to use as my build environment for a project in Bitbucket. This article shows me how to denote private container registries to specify custom images, but it only seems to include examples for Docker Hub, Amazon ECR, and Google GCR. Normally when authenticating with Digital Ocean one uses doctl, but I'm not quite sure how to use that here. Has anyone done this sort of thing before?
To be clear, I'm not asking how to push images to Digital Ocean, there's lots of literature on that. I'm asking how to specify a custom image that is already in Digital Ocean.
Thanks in advance!
Ok, answering this for anyone else that stumbles across this. Turns out you don't need doctl to authenticate when pulling an image. You can create a personal access token (take inspiration from this article, and don't give your token write-access permissions). Then, add that token to your Bitbucket repository or workspace as a secure variable. Lastly, use the variable representing your Digital Ocean token as both the username and password like so:
image:
name: registry.digitalocean.com/<your-registry>/<repo>:<tag>
username: $DIGITAL_OCEAN_TOKEN
password: $DIGITAL_OCEAN_TOKEN
The original article notes that you may need to specify an email when authenticating with a private registry, but Digital Ocean does not seem to require this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.