Docker login 报证书存储错误的解决办法

文章目录

docker login 出现错误,提示:Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

环境

使用的是 Mint Linux ,容器为 docker-ce 最新版

1 2 3 4 $ uname -a Linux m01 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ docker --version Docker version 18.09.0, build 4d60db4

问题出现

今天在 push 容器镜像时,反复提示没有权限,猜测可能是登陆了其他容器账号验证不过。当我 docker login 后才发现问题并不简单,错误完整提示:

1 2 3 4 5 $ 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: epurs Password: Error saving credentials: error storing credentials - err: exit status 1, out: Cannot autolaunch D-Bus without X11 $DISPLAY

问题解决

再往下看 Issue,感谢 chriswue 给出的详细回答,他提到这是在 Ubuntu (Mint 同样是基于 Ubuntu 的发行版)下使用 docker 特有的 bug ,而修复办法不需要特意去卸载 docker-compose ,只要 "pass" 掉验证步骤。

解决办法:
  1. 首先安装 gnupg2 和 pass 包,并生成 gpg2 key (我没有用到生成步骤一样可行)

    1 sudo apt install gnupg2 pass
    2 gpg2 --full-generate-key
  2. 查看生成的 key ,使用 pass 加载验证

    1 gpg2 -k
    2 pass init "whatever key id you have

    这里引号中 要填写前面给出的 trustdb.gpg 路径。

做完上述操作后,再使用 docker login 就没有问题了。

相关推荐
lichenyang45315 小时前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang45315 小时前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang45315 小时前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang45315 小时前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
Patrick_Wilson5 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy6 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭6 天前
运行你的第一个Docker容器
后端·docker·容器
宋均浩7 天前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
程序员老赵7 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1117 天前
LM Studio Docker 部署——本地大模型一键启动
docker