在构build过程中跳过dockerfile中的错误

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

现在我正在做这样的事情

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

这是一个典型的Linux技巧,以确保零退出代码

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

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

Dockerfile的构build – 可以忽略错误?

目前没有其他方法可以防止build设失败