Flattening out docker build file by push some RUN commands to bash scripts.