我使用的是 Ubuntu 20.04.1 LTS。 Docker 版本 19.03.12,构建 48a66213fe。
当我收到此错误时,我正尝试使用 docker pull mongo
拉取 mongo 图像:
注册层失败:处理 tar 文件时出错(退出状态 1):打开/var/lib/dpkg/info/gcc-8-base:amd64.list:参数无效
我已经卸载了docker并重新安装了。
我安装了 gcc 版本 9 和 8。我试图卸载 gcc 9 并在系统上只保留 8,但我一直收到错误。
我以为问题是因为他在错误中提到的文件丢失了,但我去了它的文件夹,文件就在那里。
我的终端:
theneverchosen@TheNeverChosen:~$ docker pull mongo
Using default tag: latest
latest: Pulling from library/mongo
f08d8e2a3ba1: Extracting 26.7MB/26.7MB
3baa9cb2483b: Download complete
94e5ff4c0b15: Download complete
1860925334f9: Download complete
9d42806c06e6: Download complete
31a9fd218257: Download complete
5bd6e3f73ab9: Download complete
f6ae7a64936b: Download complete
80fde2cb25c5: Download complete
1bec62fe62fc: Download complete
2cf4970a1653: Download complete
39fac3226e16: Download complete
86bca9c64faf: Download complete
failed to register layer: Error processing tar file(exit status 1): open /var/lib/dpkg/info/gcc-8-base:amd64.list: invalid argument
theneverchosen@TheNeverChosen:~$ docker --version
Docker version 19.03.12, build 48a66213fe
theneverchosen@TheNeverChosen:~$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
theneverchosen@TheNeverChosen:~$ gcc-8 --version
gcc-8 (Ubuntu 8.4.0-3ubuntu2) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
最佳答案
我阅读此信息解决了这个问题:
https://docs.docker.com/engine/security/rootless/#docker-pull-errors
我读了这个链接就明白了:
https://docs.oracle.com/cd/E37670_01/E75728/html/ol-docker-userns-remap.html
并增加这些文件(/etc/subuid 和/etc/subgid)中包含的值并按照此链接推荐的方式重新启动(未提及):
https://ubuntu.com/blog/custom-user-mappings-in-lxd-containers
我唯一注意到的是我的存储磁盘路径从“DATA”重命名为“DATA1”,我不知道为什么会这样。 DATA 在终端上无法访问,带有典型的“权限被拒绝”消息,而在 GUI 文件浏览器中,它始终显示为“DATA”。但是,嘿,我终于能够拉出我想要的形象,我可以从此过上幸福的生活。 :D!
关于mongodb - Docker 注册层 mongo 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63559895/