Dockerfile构建 - 可以忽略错误? [英] Dockerfile build - possible to ignore error?
问题描述
automake:error:没有为任何配置找到Makefile.am输出
错误构建:命令[/ bin / sh -c aclocal&& autoconf&& automake -a]返回一个非零代码:1
这在现实中是无害的。该库构建良好,但Docker收到此错误后会停止构建。有什么办法可以指导Docker忽略这个吗?
当然可以。 Docker只是响应 Dockerfile
中的 RUN
shell脚本返回的错误代码。如果您的 Dockerfile
具有以下内容:
RUN make
您可以将其替换为:
code> RUN make;退出0
这将始终返回一个 0
(成功)退出代码。这里的缺点是,即使在构建过程中 实际的错误,您的图像也将显示为成功。
I've got a Dockerfile. When building the image, the build fails on this error:
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
which in reality is harmless. The library builds fine, but Docker stops the build once it receives this error. Is there any way I can instruct Docker to just ignore this?
Sure. Docker is just responding to the error codes returned by the RUN
shell scripts in the Dockerfile
. If your Dockerfile
has something like:
RUN make
You could replace that with:
RUN make; exit 0
This will always return a 0
(success) exit code. The disadvantage here is that your image will appear to build successfully even if there are actual errors in the build process.
这篇关于Dockerfile构建 - 可以忽略错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!