title: Why docker run saying Unknown operand whilst same shell script runs perfectly in ubuntu machine
body: <p>I am trying to execute a <code>./login.sh</code> as a part of <code>docker run</code> now when i run the <code>./login.sh</code> in ubuntu machine i see success response but when i create a docker image i see output as <code>sh: abc: unknown operand “invalid url”</code></p>
  
  <p>Here is contents of <code>./login.sh</code></p>
  
  <pre><code> #!/bin/sh
   # Black Box Tester!
  
  
  content=$(curl  --location --request POST "https://api.platform.abc.com. 
  /auth/oauth/token" --header 'Content-Type: application/x-www-form- 
  urlencoded' \
   --header 'Authorization: Basic V0zSA==' --data-raw 'grant_type=password&amp;
  username=test@example.com&amp;password=123456'| jq -r '.domain_id' )
  if [ $content = abc ]
       then
            echo “Valid Login Token”
  else
            echo “invalid url”
  fi
  </code></pre>
  
  <p>and here is contents of docker file</p>
  
  <pre><code>FROM ubuntu:16.04
  
  RUN apt-get update &amp;&amp; apt-get install -y curl   \
      &amp;&amp; apt-get -y install jq
  
  
  FROM openjdk:8-jre-alpine
  
  RUN apk --no-cache add curl jq
  
  
  WORKDIR /opt
  
  
  ADD login.sh /opt
  
  RUN pwd  \
     &amp;&amp; find /opt
  
  
  
  CMD ["./login.sh"]
  </code></pre>
  
  <p>When same <code>./login.sh</code> i execute normally in Ubuntu machine i get successful output as </p>
  
  <pre><code>    ubuntu@ip-172-31-29-248:~$ ./login.sh 
     % Total    % Received % Xferd  Average Speed   Time    Time     Time    
    Current
                               Dload  Upload   Total   Spent    Left  Speed
  100  2034  100  1958  100    76   9458    367 --:--:-- --:--:-- --:--:--  
  9873
  “Valid Login Token”
  </code></pre>
  
  <p>Here is output of <code>sudo docker run lots/loginimage</code></p>
  
  <pre><code> ubuntu@ip-172-31-29-248:~$ sudo docker run lots/loginimage
   ./login.sh: line 6: jq: not found
     % Total    % Received % Xferd  Average Speed   Time    Time     Time       
   Current
                               Dload  Upload   Total   Spent    Left  Speed
   92  2034   92  1807  100    76   7199    302 --:--:-- --:--:-- --:--:--      
  7501
  curl: (23) Failed writing body (0 != 1024)
  sh: abc: unknown operand
  “invalid url”
  </code></pre>
  
  <p>Can some one let me know why the login script which is simply a curl command runs sucessfully in ubuntu machine but same login script shows else condition in docker run?</p>
  
  <p>Also i have included a code in docker file to download and install Json path <code>jq</code> but why image still says <code>./login.sh: line 6: jq: not found</code>??</p>
  
  <p>your help is highly appreciated</p>