I am moving a legacy PHP application running in Apache under Ubuntu 14.04 to Docker for further development.
Therefore I need the PHP engine to have the same modules installed as the Ubuntu install, and I would like to verify automatically in my Dockerfile that the output from php -m contains the same modules as a cached output from php -m on the Ubuntu machine.
In a shell script I would expect this to be doable using exit codes and set -e. The Dockerfile documentation does not mention anything about exit codes from the RUN command so it is probably not doable.
So, question is generally "How can I make my Dockerfile build fail from code" but I have asked it specifically for my use case as there might be a smarter way to do it.
Suggestions?