question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work on Goharbor? - Token authentication

See original GitHub issue

Hi, I’m running Goharbor . It’s running behind nginx reverse proxy with its own domain. Ex: reg.mydomain.com, it doesn’t have basic auth, because goharbor has its own authentication method. Check its demo here. Right now I’m logged into my goharbor server and run the script like this:

docker run -it -v /data/registry:/registry -e REGISTRY_URL=https://reg.mydomain.com -e DRY_RUN="true" mortensrasmussen/docker-registry-manifest-cleanup

Ofc it returns

Got an authentication error connecting to the registry. Check credentials, or add REGISTRY_AUTH='username:password'
Exiting

Then I’ve tried like this:

docker run -it -v /data/registry:/registry -e REGISTRY_URL=https://user:pass@reg.mydomain.com -e DRY_RUN="true" mortensrasmussen/docker-registry-manifest-cleanup

or

docker run -it -v /data/registry:/registry -e REGISTRY_URL=https://reg.mydomain.com -e REGISTRY_AUTH='user:pass'-e DRY_RUN="true" mortensrasmussen/docker-registry-manifest-cleanup

Both didn’t work. What should I do?

If I run the script directly to port 5000

➜ docker run -it -v /data/registry:/registry -e REGISTRY_URL=http://127.0.0.1:5000 -e DRY_RUN="true" mortensrasmussen/docker-registry-manifest-cleanup                      
Running in dry-run mode. No changes will be made.

Running against local storage
Could not contact registry at http://127.0.0.1:5000 - error: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /v2/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f224e75cf28>: Failed to establish a new connection: [Errno 111] Connection refused',))
Exiting

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shinebayar-gcommented, Jan 3, 2019

Hey there! @mortensteenrasmussen I’m finally able to test it right now. It works like a charm! On harbor 1.7.0 Thank you very much for this project! It’s really useful! Just saved another bunch of space on my disk. 💯

1reaction
mortensteenrasmussencommented, Dec 25, 2018

Hi, I have just released version 1.1.1 which should work with harbor. You can try it out as soon as your CI/build environment has overwritten a tag (eg. latest). I’ll close this for now, but please try it out when you have time and comment here so I know if it worked. I set up harbor and tested it myself, and it seems to be working.

Best regards!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Token authentication · Issue #1410 · goharbor/harbor - GitHub
I would like to login via token, is it possible? ... As we have second factor, docker login does not work with ldap...
Read more >
Customize the Harbor Token Service
Harbor requires the Docker client to access the Harbor registry with a token. The procedure to generate a token is like Docker Registry...
Read more >
Configure OIDC Provider Authentication - Harbor docs
If you select OpenID Connect (OIDC) authentication, users log in to the Harbor interface via an OIDC single sign-on (SSO) provider, such as...
Read more >
Troubleshooting Harbor Installation
The following sections help you to solve problems when installing Harbor. Access Harbor Logs. By default, registry data is persisted in the host's...
Read more >
Configure OIDC Provider Authentication - Harbor docs
In this case, log out and log back in to Harbor via your OIDC provider so that Harbor can get a new ID...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found