【问题标题】:Skip error in dockerfile during the build在构建期间跳过 dockerfile 中的错误
【发布时间】:2016-04-01 14:20:33
【问题描述】:

只是想知道是否有更好的方法来跳过可能失败的命令(因为我正在使用 jenkins 来构建和部署应用程序)

现在我正在做这样的事情

RUN unlink /run/supervisor.sock && etc/init.d/supervisor stop || echo "supervisor was not started"

【问题讨论】:

    标签: docker jenkins-docker


    【解决方案1】:

    这是确保退出代码为零的典型 linux 技巧

    RUN unlink /run/supervisor.sock && etc/init.d/supervisor stop || :
    

    这里给出的答案本质上是使用不同的语法来实现相同的

    Dockerfile build - possible to ignore error?

    目前没有其他方法可以防止构建失败

    【讨论】:

      猜你喜欢
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多