有关构建 Docker 映像时"apt-get update"的错误



我正在尝试构建一个自定义的docker映像,用于在ubuntu中运行一些python代码。Dockerfile如下:

FROM ubuntu:latest
LABEL maintainer="NONE"
LABEL version="0.1"
LABEL description="This is custom Docker Image for "
ARG DEBIAN_FRONTEND=noninteractive
ARG --security-opt seccomp:unconfined
RUN apt-get update
RUN apt-get install software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install python3.8
RUN mkdir file

当我尝试用以下命令构建图像时

$ docker build -t pythontest:0.1 . 

它会出现错误

Sending build context to Docker daemon  3.072kB
Step 1/12 : FROM ubuntu:latest
---> 3324772e8bdf
Step 2/12 : LABEL maintainer="NONE"
---> Using cache
---> f01ea4479da0
Step 3/12 : LABEL version="0.1"
---> Using cache
---> c47bd2e4db51
Step 4/12 : LABEL description="This is custom Docker Image for "
---> Using cache
---> 4d4e2eacd32d
Step 5/12 : ARG DEBIAN_FRONTEND=noninteractive
---> Using cache
---> fd189bb79348
Step 6/12 : ARG --security-opt seccomp:unconfined
---> Using cache
---> fcf86c83bf36
Step 7/12 : RUN apt-get update
---> Running in 3e6bc0a2f06a
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
At least one invalid signature was encountered.
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
At least one invalid signature was encountered.
Reading package lists...
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100

我试过做我在网上找到的--security-opt seccomp:unconfined,但它仍然不起作用。我能做些什么来修复它?谢谢,我是集装箱新手,如果我做错了什么,我想为此道歉。

我使用的docker版本是19.03.8,运行在树莓派4上。操作系统:Ubuntu服务器20.04

这是docker image inspect ubuntu:latest的输出

{
"Id": "sha256:3324772e8bdf660aaf741dbcac501848ddcabfe01959f3ca8c86a2a009208bea",
"RepoTags": [
"ubuntu:latest"
],
"RepoDigests": [
"ubuntu@sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1"
],
"Parent": "",
"Comment": "",
"Created": "2020-10-23T18:16:30.775377487Z",
"Container": "daa39024d37233b858422faf1f61c075e22042f4b509a2167365c47a228eac7d",
"ContainerConfig": {
"Hostname": "daa39024d372",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"CMD ["/bin/bash"]"
],
"Image": "sha256:68f8e17ca86b7256cc7d0e8837153fc04aef3c773759b39fc85e8acea31cef03",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {}
},
"DockerVersion": "19.03.12",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/bash"
],
"Image": "sha256:68f8e17ca86b7256cc7d0e8837153fc04aef3c773759b39fc85e8acea31cef03",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
"Architecture": "arm",
"Os": "linux",
"Size": 49750525,
"VirtualSize": 49750525,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/7a6c15236a35169104ea390778d70897604471cb88fe388d426e9feac647bef7/diff:/var/lib/docker/overlay2/6316859fe20573107ba86c5754b2ad30046257c9917e50a13a4ffa63ff0a789d/diff",
"MergedDir": "/var/lib/docker/overlay2/22d5e265d242fa8cf87fd5c4075958ab144dbf0712717b36fc8af41cb554a7bd/merged",
"UpperDir": "/var/lib/docker/overlay2/22d5e265d242fa8cf87fd5c4075958ab144dbf0712717b36fc8af41cb554a7bd/diff",
"WorkDir": "/var/lib/docker/overlay2/22d5e265d242fa8cf87fd5c4075958ab144dbf0712717b36fc8af41cb554a7bd/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:1891915f38b4349f99946b899c416ff2e360ff1057fb662d6ae94a9ec7ab04f0",
"sha256:7d1044b9450b57d7507221479ccd4607d86cb6e73a2fa20b6399642a807ff192",
"sha256:8ec53037c94bd75359fbb42036fa28aeda1e6b11725a0ad46f0ded867b40e227"
]
},
"Metadata": {
"LastTagTime": "0001-01-01T00:00:00Z"
}
}
]

修剪未使用的图像以释放空间。也许你操作系统上的Docker镜像已经用完了磁盘空间。这以某种方式暴露为apt报告包索引文件上的无效签名。

docker image prune -a

对于Raspbian,使用在主机系统上手动升级libseccomp

curl http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb --output libseccomp2_2.5.1-1_armhf.deb
sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

原帖在这里。

相关内容

  • 没有找到相关文章

最新更新