initialize docker-credentials-pass
话不多说,直接是上命令
hui@ubuntu:~$ 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 && chmod +x docker-credential-pass && sudo mv docker-credential-pass /usr/local/bin/
hui@ubuntu:~$ yes | sudo apt install pass
hui@ubuntu:~$ yes | sudo apt install rng-tools
hui@ubuntu:~$ yes | sudo apt install rng-tools5
hui@ubuntu:~$ gpg-agent --daemon --use-standard-socket --pinentry-program /usr/bin/pinentry-curses
hui@ubuntu:~$ sudo rngd -r /dev/urandom
hui@ubuntu:~$ gpg2 --gen-key
hui@ubuntu:~$ pass init "Your Name"
hui@ubuntu:~$ sed -i '0,/{/s/{/{\n\t"credsStore": "pass",/' ~/.docker/config.json
配置完后config.json 如下:
hui@ubuntu:~/.password-store$ cat ~/.docker/config.json
{
"auths": {
"https://index.docker.io/v1/": {}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.3 (linux)"
},
"credsStore": "pass"
}
上述命令执行完成并成功后,建议执行以下检查
1.执行:
hui@ubuntu:~$ pass insert docker-credential-helpers/docker-pass-initialized-check
-- and set the next password "pass is initialized" (without quotes).
2.
hui@ubuntu:~$ pass show docker-credential-helpers/docker-pass-initialized-check
-- You should see pass is initialized.
3.
hui@ubuntu:~$ docker-credential-pass list
-- You should see {} or another data. You shouldn`t see error like "pass store is uninitialized".