Moved a part of Dockerfile to an outside shell script.