refactor the bash file for docker build