docker 認証なし: 認証が必要 - ログインに成功したプッシュ時に質問する

docker 認証なし: 認証が必要 - ログインに成功したプッシュ時に質問する

ホストから Docker イメージをプッシュしているときに (ログイン成功後)、「unauthorized: authentication required」というメッセージが表示されます。

詳細は下記をご覧ください。

-bash-4.2# docker login --username=asamba [email protected]
WARNING: login credentials saved in /root/.docker/config.json
*Login Succeeded*
-bash-4.2#
-bash-4.2# docker push asamba/docker-whale

Do you really want to push to public registry? [y/n]: y
The push refers to a repository [docker.io/asamba/docker-whale] (len: 0)
faa2fa357a0e: Preparing
unauthorized: authentication required
  • Docker バージョン: 1.9.1 (クライアントとサーバーの両方)
  • 出典: dockerリポジトリも作成されています (asamba/docker-whale)。

/var/log/messages に 403 が表示されていますが、これが docker かどうかはわかりません。以下を参照してください。

Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884872524Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"
Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.884988574Z" level=error msg="Handler for POST /v1.21/images/asamba/docker-whale/push returned error: Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced"
Apr 16 11:39:03 localhost journal: time="2016-04-16T11:39:03.885013241Z" level=error msg="HTTP Error" err="Error: Status 403 trying to push repository asamba/docker-whale to official registry: needs to be forced" statusCode=403
Apr 16 11:39:05 localhost journal: time="2016-04-16T11:39:05.420188969Z" level=info msg="{Action=push, Username=asamba, LoginUID=1001, PID=2125}"
Apr 16 11:39:06 localhost kernel: XFS (dm-4): Mounting V4 Filesystem
Apr 16 11:39:06 localhost kernel: XFS (dm-4): Ending clean mount
Apr 16 11:39:07 localhost kernel: XFS (dm-4): Unmounting Filesystem

どのような助けでも大歓迎です。さらに情報が必要な場合はお知らせください。-f も付けてプッシュしてみましたが、うまくいきませんでした。

ベストアンサー1

Docker にログインする必要があります。

ステップ1: Docker Hubにログインする

@KaraPirinc のコメントに基づいて、Docker バージョン 17 でログインするには:

docker login -u username --password-stdin

次に、求められたらパスワードを入力します。

ステップ2: リポジトリを作成するドッカーハブ

まあ言ってみれば "mysqlサーバ:sql「」。

docker push <user username>/mysqlserver:sql

おすすめ記事