Slightly changed order of Dockerfile commands to promote reuse of intermediate images.