关于“的错误”;apt get update";在构建Docker映像时

关于“的错误”;apt get update";在构建Docker映像时,docker,ubuntu,containers,Docker,Ubuntu,Containers,我正在尝试构建一个自定义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 --sec

我正在尝试构建一个自定义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,运行在raspberry pi 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

原始帖子是。

我为同一平台下载了完全相同的图片,并手动运行了apt get更新,没有任何问题。所以对我来说,要么是上游apt回购协议的暂时性问题,要么是坏镜子,要么是网络问题。请确保您没有代理拦截请求。感谢您的帮助,我将继续调查此事。对我来说,这似乎是一个平台/网络问题。因为我的树莓皮3/4都有相同的错误。