วิธีแก้ไข “error getting credentials – err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files`”
หากใช้คำสั่ง docker login แล้วเจอ error
1 |
error getting credentials - err: exit status 1, out: `GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files` |
หรือ
1 |
Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY` |
สามารถแก้ไขได้โดย
1) Install gnupg2 pass
apt install gnupg2 pass
2) Download docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases
1 2 3 |
tar -xvf docker-credential-pass.tar.gz chmod u+x docker-credential-pass mv docker-credential-pass /usr/bin |
3) Setup docker-credential-pass
3.1) install gpg and pass (apt-get install gpg pass
)
3.2) gpg --generate-key
, ใส่ข้อมูลของเราแล้วจะได้ gpgid
1 2 3 |
pub rsa3072 2018-10-07 [SC] [expires: 2020-10-06] 1234567890ABCDEF1234567890ABCDEF12345678 |
Copy 123456789….
3.3) pass init 1234567890ABCDEF1234567890ABCDEF12345678
(paste)
3.4) pass insert docker-credential-helpers/docker-pass-initialized-check
ตรวจสอบ password
3.5) pass show docker-credential-helpers/docker-pass-initialized-check
. จะเห็นว่า password ถูกตั้งแล้ว
3.6) docker-credential-pass list
4) create a ~/.docker/config.json โดยเขียนเป็น:
1 2 3 4 |
{ "credsStore": "pass" } |
5) docker login จะใช้ได้แล้ว
Note: หากเจอ error เป็น “pass store is uninitialized” ใช้คำสั่งตามด้านล่างเพื่อ reload password จากใน memory
1 |
pass show docker-credential-helpers/docker-pass-initialized-check |