ubuntu 从Dockerfile安装apt-get返回非零代码100

gorkyyrv  于 2022-11-22  发布在  Docker
关注(0)|答案(1)|浏览(308)

我有一个Dockerfile,我想在我的机器上安装ffmpeg。但是,Dockerfile总是以下面的错误结束:

Sending build context to Docker daemon  3.371GB
Step 1/22 : FROM nvcr.io/nvidia/deepstream:6.0.1-devel
 ---> b8179aaa2d73
Step 2/22 : RUN apt-get update && apt-get upgrade -y
 ---> Running in 57df65265677
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  Could not resolve 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease              
  Could not resolve 'security.ubuntu.com'
Err:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
  Could not resolve 'developer.download.nvidia.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                
  Could not resolve 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Could not resolve 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not resolve 'security.ubuntu.com'
W: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/InRelease  Could not resolve 'developer.download.nvidia.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  cuda-libraries-11-4 cuda-libraries-dev-11-4 libcublas-11-4
  libcublas-dev-11-4 libnccl-dev libnccl2 libnvinfer-dev libnvinfer-plugin-dev
  libnvinfer-plugin8 libnvinfer8 libnvonnxparsers-dev libnvonnxparsers8
  libnvparsers-dev libnvparsers8 python3-libnvinfer python3-libnvinfer-dev
The following packages will be upgraded:
  base-files ca-certificates cuda-command-line-tools-11-4 cuda-compat-11-4
  cuda-compiler-11-4 cuda-cudart-11-4 cuda-cudart-dev-11-4
2 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
Need to get 1325 MB of archives.
After this operation, 51.2 MB disk space will be freed.
Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  cuda-nvdisasm-11-4 11.4.152-1
  Could not resolve 'developer.download.nvidia.com'
Err:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  cuda-nvtx-11-4 11.4.120-1
  Could not resolve 'developer.download.nvidia.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/base-files/base-files_10.1ubuntu2.11_amd64.deb  Could not resolve 'archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/s/shadow/login_4.5-1ubuntu2.2_amd64.deb  Could not resolve 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get update && apt-get upgrade -y' returned a non-zero code: 100

我已经尝试搜索错误,但没有找到好的解决方案。Dockerfile看起来像这样:

FROM nvcr.io/nvidia/deepstream:6.0.1-devel

#Set environment variables
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get upgrade -y
RUN apt-get install ffmpeg -y

有人知道错误可能在哪里吗?看起来代码中的“nointerarctive”env变量有问题。因为他在需要升级包之前什么都做得很好。

rsaldnfx

rsaldnfx1#

你有没有试过改变

ENV DEBIAN_FRONTEND noninteractive

ENV DEBIAN_FRONTEND=noninteractive

另外,请在此处阅读相关内容Why is DEBIAN_FRONTEND=noninteractive discouraged in Docker files?

相关问题