title: Running a shell script in docker container
body: <p>Hi helpful People of the World!</p>
  <p>i am getting into containerisation and docker and i am trying to create some basic containers.
  I am running Docker on Windows.</p>
  <p>I want to create a container that runs a shell script with a curl command. i have found an image on docker with curl built in.</p>
  <p>My Directory structure in windows looks like<br/>
  Curl_container (folder)<br/>
  Dockerfile (file)<br/>
  curl_registry.sh (file)<br/></p>
  <p>the curl_registry.sh code is</p>
  <pre><code>#!/bin/bash
      
  while :
  do
  HOSTNAME=$(hostname)
  DATE=$(date +'%Y-%m-%d')
  TIME=$(date +'%Y/%m/%d %X')
  
  CURL_RESULT=`http://www.google.com | head -1`
      
  echo $TIME  $HOSTNAME  $CURL_RESULT
  
  sleep 5
  done
  exit
  </code></pre>
  <p>and my Docker file looks like this</p>
  <pre><code>FROM eamonwoortman/alpine-python-curl-zip
  MAINTAINER red_badger@burrow.uk
  WORKDIR /
  COPY . /
  RUN [&quot;chmod&quot;, &quot;+x&quot;,&quot;curl_registry.sh&quot;]
  ENTRYPOINT [ &quot;./curl_registry.sh&quot; ]
  </code></pre>
  <p>i am able to build the container;</p>
  <pre><code>PS C:\temp\Docker\Curl_container&gt; docker build -t curl_container:1.18 .
  [+] Building 1.0s (8/8) FINISHED
   =&gt; [internal] load build definition from Dockerfile  0.0s
   =&gt; transferring dockerfile: 238B                     0.0s
   =&gt; [internal] load .dockerignore                     0.0s
   =&gt; [internal] load metadata for docker.io/eamonwoortman/alpine-python-curl-zip:latest               0.0s
   =&gt; CACHED [1/4] FROM docker.io/eamonwoortman/alpine-python-curl-zip                                 0.0s
   =&gt; [2/4] COPY . /                                                                                   0.1s
   =&gt; [3/4] RUN [&quot;chmod&quot;, &quot;+x&quot;,&quot;curl_registry.sh&quot;]                                                         
   =&gt; writing image sha256:497b03c55d8e90e7eff43c8868e420498516477b9225ad6d3bdf0076ebe9d9ed         0.0s
   =&gt; naming to docker.io/library/curl_container:1.18                                               0.0s
  </code></pre>
  <p>However when i run it, I get the following error
  <br/></p>
  <p><code>PS C:\temp\Docker\Curl_container&gt; docker run 497b03c55d8e</code> <br/>
  <code>standard_init_linux.go:228: exec user process caused: no such file or directory</code>
  <br/>
  I would like to have the script running in a folder /apps, but i thought this was my problem and so tried to put the file into the root directory.
  I have tried the ADD command in place of COPY and i got the same result.
  the curl_registry.sh is showing as a <em>.sh</em> file in windows.</p>
  <p>I have run my sh file through notepad++ and converted to unix LF.</p>