今後万が一再発したときにすぐ情報を見つけたいのでここにメモ。
1. エラー概要
docker login時に「error storing credentials…password store is empty」というエラーが返ってくる。初見。
エラーメッセージ
$ 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: masatoemata
Password:
Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `pass not initialized: exit status 1: Error: password store is empty. Try "pass init".``
2. 解決した方法
Github Issueに従って解決
https://github.com/docker/docker-credential-helpers/issues/102
↑文章形式なのでコマンドで残す
wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.0/docker-credential-pass-v0.6.0-amd64.tar.gz
tar -xf docker-credential-pass-v0.6.0-amd64.tar.gz
rm docker-credential-pass-v0.6.0-amd64.tar.gz
mv docker-credential-pass /usr/bin
sudo mv docker-credential-pass /usr/bin
docker-credential-pass version
sudo apt install gpg pass
gpg --generate-key
pass init 1EXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX28
pass insert docker-credential-helpers/docker-pass-initialized-check
pass show docker-credential-helpers/docker-pass-initialized-check
docker-credential-pass list
nano ~/.docker/config.json # "credsStore": "pass" に書き換え
docker login
3 環境
$ lsb_release -a
LSB Version: core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
$ docker -v
Docker version 23.0.0, build e92dd87