Report this

What is the reason for this report?

unauthorized: authentication required for docker compose with doctl

Posted on September 21, 2021

i use this sentence with my github action:

- name: Install doctl
  uses: digitalocean/action-doctl@v2.1.0
  with:
  token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Log in to DigitalOcean Container Registry
  run: doctl registry login --expiry-seconds 240

- name: Build and push stack
  run: TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh

This script login to DO, then builds and push images with docker-compose.yml. All is ok - i success login with doctl and build images… But when i push to registry, i see this error inside workflow:

...
Successfully built 476bb87c7501
Successfully tagged registry.digitalocean.com/***/frontend:stag
The following deploy sub-keys are not supported and have been ignored: labels
The following deploy sub-keys are not supported and have been ignored: labels
The following deploy sub-keys are not supported and have been ignored: labels
The following deploy sub-keys are not supported and have been ignored: labels
The following deploy sub-keys are not supported and have been ignored: labels
Pushing backend (registry.digitalocean.com/***/backend:stag)...
**The push refers to repository [registry.digitalocean.com/***/backend]
unauthorized: authentication required
Error: Process completed with exit code 1.**

and i receive new access token in digital-ocean admin panel, that looks like: container-registry-{name}-{ts}

Billing level of my registry is i basic and repository is empty. I think this is a problem with doctl.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi there @KonstantinKlepikov,

I encountered the same problem being logged in to sudoer account and messed things up running doctl and docker with different privileges (user/root). I ran doctl as a regular user, and docker as a root. It was like that:

doctl registry login
Output
Logging Docker in to registry.digitalocean.com
sudo docker run registry.digitalocean.com/***/testimage:1.0
Output
Unable to find image 'registry.digitalocean.com/***/testimage:1.0' locally docker: Error response from daemon: Get https://registry.digitalocean.com/v2/***/testimage/manifests/1.0: unauthorized: authentication required. See 'docker run --help'.

Everything started running fine when I set up doctl authentication with sudo command, and used it consequently since then.

I hope it gives you some clues on how to continue with troubleshooting it.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.