我有一个Dockerfile。生成映像时,由于以下错误而生成失败:
automake: error: no 'Makefile.am' found for any configure output Error build: The command [/bin/sh -c aclocal && autoconf && automake -a] returned a non-zero code: 1
这实际上是无害的。该库可以很好地构建,但是Docker在收到此错误后会停止构建。有什么办法可以指示Docker忽略这一点?
当然。Docker只是响应RUNshell脚本中返回的错误代码Dockerfile。如果您Dockerfile有以下内容:
RUN
Dockerfile
RUN make
您可以将其替换为:
RUN make; exit 0
这将始终返回0(成功)退出代码。这里的缺点是,你的形象将出现,成功地构筑即使 是 在构建过程中实际发生的错误。
0