Doesn't work on Goharbor? - Token authentication
See original GitHub issueHi, 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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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. 💯
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!