【问题标题】:The command '/bin/sh -c chmod +x a.deb && apt-get install a.deb' returned a non-zero code: 1 [duplicate]命令 '/bin/sh -c chmod +x a.deb && apt-get install a.deb' 返回一个非零代码:1 [重复]
【发布时间】:2021-08-01 21:04:57
【问题描述】:

我一直在尝试为 .deb 文件编写 dockerfile。这是我到目前为止所写的:

FROM ubuntu:18.04 AS ubuntu

RUN apt-get update

WORKDIR /invisily

COPY . ./

USER root
RUN chmod +x a.deb && \
    apt-get install a.deb

所有阶段都运行良好,但最后我收到一条错误消息:

Need to get 79.6 MB of archives.
After this operation, 296 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c chmod +x a.deb &&     apt-get install a.deb' returned a non-zero code: 1

这可能是什么原因?

【问题讨论】:

    标签: docker docker-compose dockerfile


    【解决方案1】:

    您在 apt-get 命令中缺少 -y 以自动接受确认问题并以非交互方式运行。

    从日志中可以看出,apt-get 正在向用户提问(期望通过键盘给出 Y/N 答案),但由于与用户没有交互,因此它被中止。

    【讨论】:

    • 谢谢!
    猜你喜欢
    • 2019-10-09
    • 1970-01-01
    • 2019-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-19
    相关资源
    最近更新 更多