build dockerfile时报错了

来源:3-6 镜像的构建和分享

ienoon

2021-11-13

老师您好,我在执行build命令的时候,就出现了这个错误,表示看不懂,请老师指导一下。

我的镜像源替换成了我个人的阿里云镜像仓库,pull其他镜像都没问题,挺快的。


[root@69iwentestserv dockerfiletest]# clear
[root@69iwentestserv dockerfiletest]# docker image build -t hello .
Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM ubuntu:21.04
 ---> de6f83bfe0b6
Step 2/4 : RUN apt-get update &&     DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3.9 python3-pip python3.9-dev
 ---> Running in 4b1d4521eaf8
Get:1 http://security.ubuntu.com/ubuntu hirsute-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu hirsute InRelease [269 kB]
Err:1 http://security.ubuntu.com/ubuntu hirsute-security InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://archive.ubuntu.com/ubuntu hirsute InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease [115 kB]
Err:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease [101 kB]
Err:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease
  gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists...
W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-updates InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-backports InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-backports InRelease' is not signed.
The command '/bin/sh -c apt-get update &&     DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3.9 python3-pip python3.9-dev' returned a non-zero code: 100
[root@69iwentestserv dockerfiletest]#

写回答

1回答

麦兜搞IT

2021-11-15

您好,这个Dockerfile,然后把基础镜像改了么

FROM ubuntu:21.04
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y python3.9 python3-pip python3.9-dev
ADD hello.py /
CMD ["python3", "/hello.py"]



0
3
小小奥
回复
麦兜搞IT
我也遇到了这个问题,我把ubuntu的版本降到20.04就build成功了
2023-03-07
共3条回复

Docker 系统性入门+进阶实践

Docker 完整知识体系及使用指南&优质实践

1953 学习 · 329 问题

查看课程