moving docker build and push in a function