Docker 이미지를 빌드 할 때 "apt-get update"에 대한 오류

Nov 15 2020

우분투에서 일부 파이썬 코드를 실행하기위한 사용자 지정 도커 이미지를 구축하려고합니다. 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인터넷에서 찾은 작업 을 시도 했지만 여전히 작동하지 않습니다. 이 문제를 해결하려면 어떻게해야합니까? 고맙습니다, 저는 용기를 처음 사용합니다. 내가 잘못하면 사과하고 싶습니다.

내가 사용중인 도커 버전은 19.03.8이며 라즈베리 파이 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"
        }
    }
]

답변

Ashok Nov 15 2020 at 17:15

사용하지 않는 이미지를 정리하여 공간을 확보하십시오. OS의 Docker 이미지에 디스크 공간이 부족했을 수 있습니다. 그것은 어떻게 든 apt패키지 색인 파일에 대한 잘못된 서명을보고하는 것으로 드러났습니다 .

docker image prune -a