title: command not found when running in docker bash script
body: <p>I have a docker-compose file that executes a bash script on entry.</p>
  
  <p>This bash script removes a few files, and then attempts to <code>printenv</code> which returns the error <code>printenv: not found</code></p>
  
  <p>Now if I run the docker container in interactive mode and execute the <code>printenv</code> it works fine.</p>
  
  <p><strong>Running docker in interactive mode</strong></p>
  
  <p><code>docker run -it microsoft/aspnetcore-build /bin/sh</code></p>
  
  <p><code>&gt; printenv</code> works fine</p>
  
  <p><strong>Running in docker-compose</strong></p>
  
  <pre><code>docker-compose -f docker-compose-build.yml up
  
  Starting ci_aspnetapp-build_1
  Attaching to ci_aspnetapp-build_1
  aspnetapp-build_1  | rm -rf ../**/bin -&gt; Done
  aspnetapp-build_1  | rm -rf ../**/obj -&gt; Done
  aspnetapp-build_1  | ./ci/build.sh: 8: ./ci/build.sh: printenv: not found
  ci_aspnetapp-build_1 exited with code 127
  </code></pre>
  
  <p><strong>Bash Script (build.sh)</strong></p>
  
  <pre><code>#!bin/bash
  set -e
  rm -rf ../**/bin
  printf "rm -rf ../**/bin -&gt; Done\n"
  rm -rf ../**/obj
  printf "rm -rf ../**/obj -&gt; Done\n"
  rm -rf ../**/publish/web
  printenv
  printf "rm -rf ../**/publish/web -&gt; Done\n"
  </code></pre>
  
  <p><strong>Docker-Compose File (docker-compose-build.yml)</strong></p>
  
  <pre><code>version: '2'
  services:
    aspnetapp-build:
      image: microsoft/aspnetcore-build
      volumes:
        - ../.:/sln
      working_dir: /sln
      entrypoint: ["sh", "./ci/build.sh"]
  </code></pre>