简体   繁体   English

apt-get install from Dockerfile 返回非零代码 100

[英]apt-get install from Dockerfile returns non zero code 100

I have a Dockerfile in which I want to install ffmpeg on my machine.我有一个 Dockerfile,我想在我的机器上安装 ffmpeg。 However, the Dockerfile always ends with the following error:但是,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

I already tried searching for the error but couldn't find a good solution.我已经尝试搜索错误但找不到好的解决方案。 The Dockerfile looks like this: 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

Does someone have an idea where the error could be?有人知道错误可能在哪里吗? It seems like the code has a problem with the "nointerarctive" env variable.似乎代码的“nointerarctive”环境变量有问题。 Because he does everything right until he needs to upgrade the packages.因为在他需要升级软件包之前,他所做的一切都是对的。

Have you tried to change你试过改变吗

ENV DEBIAN_FRONTEND noninteractive

to

ENV DEBIAN_FRONTEND=noninteractive

Also, have a read about this hereWhy is DEBIAN_FRONTEND=noninteractive discouraged in Docker files?另外,在这里阅读一下为什么 DEBIAN_FRONTEND=noninteractive 不鼓励在 Docker 文件中使用?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dockerfile Image命令'/ bin / sh -c apt-get install -y mysqld-server'返回了非零代码:100 - Dockerfile Image The command '/bin/sh -c apt-get install -y mysqld-server' returned a non-zero code: 100 Docker - “命令‘/bin/sh -c apt-get install nodejs’返回非零代码:100” - Docker - "The command '/bin/sh -c apt-get install nodejs' returned a non-zero code: 100" Win10 上的 Docker - apt-get install 返回非零代码:100 - Docker on Win10 - apt-get install returned a non-zero code: 100 apt-get update' 返回一个非零代码:100 - apt-get update' returned a non-zero code: 100 Docker Build错误:命令“ / bin / sh -c apt-get install –y apache2”返回了非零代码:100 - Docker Build Error : The command '/bin/sh -c apt-get install –y apache2' returned a non-zero code: 100 命令“/bin/sh -c apt-get install erlang”返回非零代码:1 - The command '/bin/sh -c apt-get install erlang' returned a non-zero code: 1 命令“/bin/sh -c apt-get install dnsutils”返回非零代码:1 - The command '/bin/sh -c apt-get install dnsutils' returned a non-zero code: 1 命令 '/bin/sh -c apt-get update && apt-get upgrade' 返回一个非零代码:1 - The command '/bin/sh -c apt-get update && apt-get upgrade' returned a non-zero code: 1 在 Dockerfile 中临时缓存 RUN apt-get update && apt-get install - Temporarily cache RUN apt-get update && apt-get install in Dockerfile 使用apt-get install gcc时Dockerfile构建错误 - Dockerfile build error when use apt-get install gcc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM