• notice
  • Congratulations on the launch of the Sought Tech site

When docker logs in on the server, it prompts Error saving credentials: error storing credentials

  Register at https://hub.docker.com/ before pushing the image package to the docker official website, and use docker login to log in after the image is ready on the server.


[email protected] :/ home / # docker login Username : you username
Password : passwd

    After logging in to docker on the server and entering the account password, an error message is displayed: Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`. According to the prompt, it means that the credential cannot be stored. There are many methods on the Internet, such as switching to the .docker directory, etc., which do not work. I found a feasible method in a comment on stackoverflow.com. The address is as follows: https://stackoverflow.com/questions/42787779/docker-login-error-storing-credentials-write-permissions-error


Solution: Install the following packages to solve this issue.
[email protected]:/home/# apt install gnupg2 pass

GnuPG is the abbreviation of GNU Privacy Guard, which is a completely open source and free implementation of the OpenPGP standard (defined by RFC4880). pass is a simple command-line password manager for Linux that stores passwords in a gpg-encrypted file. These encrypted files are well organized and stored in a directory structure.

After successful login, it will prompt that the key certificate is stored in the following location, which can be configured to close this prompt.

WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials- store

    Before pushing the image package to the docker official website, you need to change the local docker image name to your official registered user name for docker, because the official image warehouse is named after the user name. You can only upload to your own warehouse. If the name is wrong and uploaded, you will get an error denied: requested access to the resource is denied, that is, the permission is denied. Then execute the docker push command. To add a tag to docker, use the docker tag command. If you want to delete the tag of a mirror, use docker rmi -f as follows:

[email protected] :/ home / # docker tag fastapi-gunicorn-server:v1.0 kermitcode/fastapi-gunicorn-server:v1.0
[email protected] :/ home / # docker push kermitcode/fastapi-gunicorn-server:v1. 0 #delete tag
[email protected] :/ home / # docker rmi -f kermitcode/fastapi-gunicorn-server:v1.0




Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+