docker - 命令“/bin/sh -c apt-get install dnsutils”返回非零代码:1
问题描述
尝试在 docker 构建期间安装 dnsutils。
Dockerfile:
# Dockerfile - this is a comment. Delete me if you want.
FROM python:2.7
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
RUN apt-get update
RUN apt-get install dnsutils
CMD ["python","unitTest.py"]
输出:
Do you want to continue? [Y/n] Abort.
The command `/bin/sh -c apt-get install dnsutils` returned a non-zero code: 1
如何在图像中安装 dig 而不会出现上述错误?
解决方案
添加-y
它以自动接受并保持非交互 -
RUN apt-get install -y dnsutils
推荐阅读
- sql - TO_CHAR 来自 Date 数据类型输出差异
- javascript - 如何测试一个元素是否具有特定的类?
- android - 修复 HostnameVerifier 的不安全实现
- amazon-s3 - 从远程实例写入 S3
- python - Panda column value change based on another column by lamda function
- javascript - jquery .then 不会抛出错误
- azure-servicebus-queues - 是否有 Azure 服务总线消息过期事件
- flutter - 发生异常。NoSuchMethodError Flutter 验证错误
- cordova - 是否可以将网站包装在cordova应用程序中,但保持服务器会话并在底部添加固定栏菜单?
- node.js - 如何为 ExpressJS 路由保持 Nginx 上游?