LoginSignup
9
5

More than 5 years have passed since last update.

Docker pullでERROR: unauthorized: authentication requiredが出た時のエラー解消法

Posted at

Dockerでphpmyadminのimageをpullしてbuildしようとした際に発生した[ ERROR: unauthorized: authentication required ] エラーの解消方法です。
結論から言うと、俺はインターネット回線不調のケースでした。認証エラーと表示されていたから何回もDockerHubの再ログインや設定情報を見直していたりしてたけど「そっち!?」って感じであっけなく終わりました。

バージョン情報

  • Mac OS 10.11.6(El Capitan)
  • Docker Toolbox
    • Docker version 18.03.0-ce
    • Oracle VM VirtualBox Manager 5.2.12

その他情報

エラー内容

imageをpullしている際[ ERROR: unauthorized: authentication required ]と、エラーメッセージに認証エラーと表示され、途中でダウンロードが止まる。

80c35484f704: Pulling fs layer
f1756f88345d: Pull complete
a73fef5319c1: Pull complete
cc5642v54c68: Downloading [======>                                            ] 100.6 MB/778.4 MB
5203f0cbc5e4: Download complete
2847cfad3893: Downloading [=======>                                           ] 60.78 MB/404.6 MB
7b8f9e71437d: Download complete
4a33d6e054a0: Downloading
a227293ed9ac: Waiting
ERROR: Service 'phpmyadmin/phpmyadmin' failed to build: unauthorized: authentication required

解消方法

DockerHubにログインしていないケース

$ docker login
Username (****):
Password: 

imageを利用して作業する際は、DockerHubにログインして行います。

~/.docker/config.jsonの[ https] 情報が間違っているケース

$vi ~/.docker/config.json
"auths": {
        "https://index.docker.io/v1/": {
                "auth": "****************************"
        }
},

[ https://index.docker.io/v1/ ] になっているか確認して、必要があれば修正します。

インターネット回線不調のケース

imageをpullする際imageサイズが大きく、また、使用しているインターネット回線が遅い場合に[ ERROR: unauthorized: authentication required ]になりますので、違う回線を使用したりするなどして再度試す。

参考
9
5
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
9
5