title: How to stop building When I use Dockerfile build image?
body: <p>I write some shell codes in my Dockerfile below to check some directories in container, if it doesn't have those folders I want to stop building.So what should I write in the Dockerfile to stop it?</p>
  
  <pre><code>FROM XXX
  ...
  RUN if [ -d "/app/bin" -a  -d "/app/lib" -a -d "/app/conf" -a -d "/app/resource" -a -d "/app/log" -a -f "/app/bin/start.sh" ]; then mkdir -p /app/control/bin;  else SOME_CODES_TO_STOP_BUILDING; fi
  ...
  </code></pre>