Reordered RUN commands to reduce layers of docker image significantly