执行docker login 时报错Error saving credentials: error storing credentials

4,198 阅读1分钟

按照docker官网文档把image推到docker hub仓库时,在执行docker login -u [username]时报错:

Error saving credentials: error storing credentials - err: exit status 1, out: `Post "https://hub.docker.com/v2/users/login?refresh_token=true": dialing hub.docker.com:443 with direct connection: connecting to 31.13.69.245:443: dial tcp 31.13.69.245:443: connectex: No connection could be made because the target machine actively refused it.`

再执行一次又报类似的错:

Error saving credentials: error storing credentials - err: exit status 1, out: `Post "https://hub.docker.com/v2/users/login?refresh_token=true": dialing hub.docker.com:443 with direct connection: connecting to 108.160.161.20:443: dial tcp 108.160.161.20:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.`

当打开梯子后错误变成了:

Error saving credentials: error storing credentials - err: exit status 1, out: `Post "https://hub.docker.com/v2/users/login?refresh_token=true": EOF`

在stackoverflow看到这篇

image.png

我也尝试删除我的C:\Users\[用户名]\.docker\config.json,然后再执行docker login -u [username]就正常了:

image.png