本文介绍了关于"apt-get更新"的错误;构建Docker映像时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to build a custom docker image for running some python code in ubuntu. The Dockerfile is as follows:

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

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

When I try to build the image with the following command

$ 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 (我在Internet上找到了它),但是它仍然无法正常工作.我该如何解决?谢谢,我是容器的新手,如果我做错了任何事,我要为此道歉.

I've tried to do --security-opt seccomp:unconfined which I found on the internet, but it still doesn't work.What can I do to fix it? Thank you, I am new to containers, if I do anything wrong I'd like to apologize for it.

我正在使用的docker版本是19.03.8,在raspberry pi 4上运行.操作系统:Ubuntu Server 20.04

The docker version that I'm using is 19.03.8, running on raspberry pi 4.OS: Ubuntu Server 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"
        }
    }
]

推荐答案

对于Raspbian,使用以下命令在主机系统上手动升级 libseccomp :

For Raspbian, upgrade libseccomp manually on the host system by using:

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更新"的错误;构建Docker映像时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 17:38