Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capability to authenticate with docker account when pulling images #59

Closed
thewookiewon opened this issue Jan 24, 2024 · 5 comments
Closed

Comments

@thewookiewon
Copy link

Would it be possible to add an option to pass an API token to allow authenticated docker pulls?

Basically getting the below error

You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

@mag37
Copy link
Owner

mag37 commented Jan 25, 2024

How/where would you need the API-token? Like how is it used?

My understanding is that all you've got to do is to first login with docker login --username=yourUsername and then start pulling. But I might be wrong or maybe misunderstood the issue, have not needed to troubleshoot this myself.

(link to docker-commandline-login docs )

@mag37
Copy link
Owner

mag37 commented Feb 1, 2024

I would need some more info to be able to continue on this, know the actual issue / preferred outcome.

@theroninhunter

@thewookiewon
Copy link
Author

Yes I can just do that docker login --username=yourUsername

Maybe I was just looking for that capability to be added to the app BUT happy if you prefer to close this FR.

@mag37
Copy link
Owner

mag37 commented Feb 1, 2024

You could create yourself a function in your .bashrc or so.

Something like

function dchk {
  docker login --username YourUser
  /home/user/dockcheck.sh "$@"
}

Then you can run eg. dchk -yp -e nginx or whatever flags/arguments needed and it would first prompt your login.

Or if you'd like to not have to write the password, but read it from a file:

function dchk {
cat ~/pwd.txt | docker login --username YourUser --password-stdin
~/dockcheck.sh "$@"
}

Edit as necessary (paths, usernames etc).

@mag37
Copy link
Owner

mag37 commented Feb 2, 2024

Added this suggestion to the Readme, wont implement it to the actual script - closing.

@mag37 mag37 closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants