• Cannot login to Docker account


    Asked 2 years, 6 months ago
    Active 3 months ago
    Viewed 67k times
     
    121
    OS: Ubuntu 18.04 Server
    Docker 18.3 CE
    

    I am logged onto the server, from my Windows 10 laptop, using a PuTTY SSH session.

    I don't have Docker on my local Windows laptop, so all the work is done on the remote server.

    I can execute all Docker commands, on the remote server, using the terminal session.

    However, when I try to save my image to the Docker hub, when I try to login, using:

    docker login
    

    I get the following error message:

    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`
    

    I did not get any error messages, when I created my image on the remote server.

    I also do not see a .docker folder in the related home directory on the remote server. Any ideas?

    share  improve this question   
    •  
      I ran into a somewhat similar problem today while trying to run docker login from within a LXD/LXC container. That particular one I solved by copying .docker/config.json from my host over to my $HOME/.docker/ directory within the LXD/LXC container, which I created manually. I'm currently trying to figure out another issue now, but wanted to ask if you had you tried doing this yet? – code_dredd May 9 '18 at 22:07
    •  
      No, I sort of gave up on Windows. I am getting a new laptop tomorrow, where I will be installing Ubuntu 18 as a dual boot. – EastsideDev May 9 '18 at 22:12
    •  
      I have opened up an issue for this here github.com/docker/cli/issues/1136. If they find a solution for this, I'll post it here. – thishandp7 Jun 21 '18 at 9:26

    12 Answers

    206
     

    Edit 2019-04-07:

    As this is the currently selected answer, I think people should try @Anish Varghese solution below first as it seems to be the easiest. You only need to install the gnupg2 and pass packages:

    sudo apt install gnupg2 pass

    If it doesn't work, then you can try my original solution here:

    I had the same issue. bak2trak answer worked, but it saved credentials in clear text. Here's the solution if you want to keep them in a password store.

    1) Download docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases

    2) tar -xvf docker-credential-pass.tar.gz

    3) chmod u+x docker-credential-pass

    4) mv docker-credential-pass /usr/bin

    5) You will need to setup docker-credential-pass (following steps are based of https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452)

    5.1) install gpg and pass (apt-get install gpg pass)

    5.2) gpg --generate-key, enter your information. You should see something like this:

    pub   rsa3072 2018-10-07 [SC] [expires: 2020-10-06]
          1234567890ABCDEF1234567890ABCDEF12345678
    

    Copy the 123... line

    5.3) pass init 1234567890ABCDEF1234567890ABCDEF12345678 (paste)

    5.4) pass insert docker-credential-helpers/docker-pass-initialized-check and set the next password "pass is initialized" (without quotes).

    5.5) pass show docker-credential-helpers/docker-pass-initialized-check. You should see pass is initialized.

    5.6) docker-credential-pass list

    6) create a ~/.docker/config.json with:

    {
    "credsStore": "pass"
    }
    

    7) docker login should now work

    Note: If you get the error "pass store is uninitialized" in future run, run the below command (it will reload the pass store in memory):

    pass show docker-credential-helpers/docker-pass-initialized-check
    

    It will ask your password and it will initialize the pass store.

    This is based off this discussion: https://github.com/moby/moby/issues/25169#issuecomment-431129898

    share  improve this answer   
    •  
      Didn't work for me. I get the message when I try docker login: "error getting credentials - err: exit status 1, out: `pass store is uninitialized" – GlacialSpoon Oct 29 '18 at 13:02 
    •  
      I started again after uninstalling pass and deleting the .password-store folder. Seems better now. Thanks. – GlacialSpoon Oct 29 '18 at 13:43
    • 2
      @Jean-Phillipe Jodoin, thanks. It seems I have to call this periodically otherwise the login call fails to find the credentials. I read this might be something to do with the gpg cache expiring and the "pass show" wakes it up. When the server reboots I have to go back to the "pass insert" step before things work. It's not very convenient but it is allowing me to proceed. – GlacialSpoon Oct 30 '18 at 15:08 
    • 1
      Check the answer by Anish Varghese below, it seems to be the easiest and cleanest solution. – Aurelien Nov 22 '18 at 2:58
    • 1
      @JoePhillips: Agreed with you. Integrated his solution with citation. – Jean-Philippe Jodoin Apr 7 '19 at 12:01
     
    214

    Install the following Packages in ubuntu fixed my issue

    sudo apt install gnupg2 pass
    
    share  improve this answer   
    • 1
      didn't work for me, but also installing gpg worked: "sudo apt install gnupg2 pass gpg" – Jörg Beyer Dec 29 '18 at 17:27 
    • 6
      Worked for me on ubuntu 18.04 too. I only issued sudo apt install pass, the rest came as its dependencies – Álex Mar 21 '19 at 15:09
    • 4
      Worked for me on Unbuntu 18.04. – Gill Bates Jul 13 '19 at 17:39
    • 5
      What is the root of the problem? and why how gnupg2 pass will fix the problem? – Neo Dec 9 '19 at 4:55 
    • 1
      Worked for me at ubuntu 19.04 too – Ammad Khalid Mar 24 at 22:11
  • 相关阅读:
    理解SQL SERVER中非聚集索引的覆盖,连接,交叉和过滤
    TSQL查询进阶流程控制语句
    效率最高的Excel数据导入(c#调用SSIS Package将数据库数据导入到Excel文件中【附源代码下载】)
    SQL Service自定义数据类型
    理解SQL SERVER中的逻辑读,预读和物理读
    TSQL查询进阶深入理解子查询
    SQL查询入门(下篇)
    使用SQL进行递归查询
    利用 sys.sysprocesses 检查 Sql Server的阻塞和死锁
    灵活运用 SQL SERVER FOR XML PATH
  • 原文地址:https://www.cnblogs.com/mouseleo/p/13940006.html
Copyright © 2020-2023  润新知