请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

build dockerfile时报错了

老师您好,我在执行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]#

正在回答 回答被采纳积分+3

1回答

麦兜搞IT 2021-11-15 04:43:20

您好,这个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 回复 有任何疑惑可以回复我~
  • 提问者 ienoon #1
    基础镜像是按照您课程上写的那样,我看也就是您回复的这样,代码一模一样。
    回复 有任何疑惑可以回复我~ 2021-11-15 08:00:27
  • 麦兜搞IT 回复 提问者 ienoon #2
    不太清楚原因,试试这个呢https://stackoverflow.com/questions/59139453/repository-is-not-signed-in-docker-build
    回复 有任何疑惑可以回复我~ 2021-11-18 05:47:50
  • 我也遇到了这个问题,我把ubuntu的版本降到20.04就build成功了
    回复 有任何疑惑可以回复我~ 2023-03-07 13:40:14
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信