LoginSignup
29
15

More than 3 years have passed since last update.

DockerHubへのdocker loginが出来なかった場合の対処

Posted at

現象

DockerHubにimageをpushしたいのに docker login が出来ませんでした。ログとしては以下のような形。Ubuntu18.04へteratermでログインし実行したコマンドログです。

$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: XXXXXXX
Password:
Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

ssh経由での操作が影響してたりするかな?と思い直にコマンドを打つと今度は"Timeout was reached"というエラーに変わっていました。うーむ

対処

Dockerのissue経由で以下stackverflowに行きつき解決。

gnupg2, passという2つのパッケージが必要でした。

sudo apt install gnupg2 pass

上記をインストールすると無事解決。docker pushも実行することが出来ました。

$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: XXXXXXX
Password:
WARNING! Your password will be stored unencrypted in /home/htsuji/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
29
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
15