title: Why docker image build throws /usr/bin/env: ‘sh\r’: No such file or directory?
body: <p>Building docker image.......
  <strong>/usr/bin/env: ‘sh\r’: No such file or directory</strong>
  execution failed</p>
  
  <p><strong>complete script</strong></p>
  
  <pre><code>#!/bin/bash
   echo "Building docker image......."
  . gradle.properties
   IMAGE="$dockerRegistry/$1"
   IMAGE_TAG="$releaseVersion-$(git log -1 --pretty=%h)"
   if ./gradlew clean :$1:jibDockerBuild -x test; then
   echo "Pushing docker image...."
   docker tag $IMAGE $IMAGE:$IMAGE_TAG
   docker push $IMAGE:$IMAGE_TAG
   else
   echo "execution failed"
   exit 1
    fi
   exit 0
  </code></pre>