title: Docker container restarting on defining an entrypoint
body: <p>I'm trying to run a shell script as entrypoint in my docker container. For this, I defined an entrypoint in my Dockerfile like this</p>
  
  <p><strong>abc.Dockerfile</strong></p>
  
  <pre><code>FROM ubuntu
  COPY abc.sh /
  RUN chmod +x /abc.sh
  ENTRYPOINT /abc.sh
  </code></pre>
  
  <p>Dockerfile gets built successfully, but on doing <code>exec</code> into the container I'm getting an error:</p>
  
  <pre><code>$ docker exec -it drupaldocker_myapp_1 bash
  Error response from daemon: Container ca32bafe2247e51d5e9b1a8f0cf83457ccecb29e8ff9747a8c98aa6a046b0550 is restarting, wait until the container is running
  </code></pre>
  
  <p>Ouput of <strong>docker ps:</strong></p>
  
  <pre><code>Raghav-Macbook:iflychat-server-development-system raghav$ docker ps
  CONTAINER ID        IMAGE                COMMAND                    CREATED             STATUS                         PORTS                    NAMES
  ca32bafe2247        drupaldocker_myapp   "/bin/sh -c \"/abc.sh\""   9 minutes ago       Restarting (0) 2 minutes ago                            drupaldocker_myapp_1
  </code></pre>
  
  <p>My <strong>docker-compose.yml</strong> looks like</p>
  
  <pre><code>version: '2'
  services:
    myapp:
     build:
      context: .
      dockerfile: abc.Dockerfile
     restart: always
     tty: true
  </code></pre>
  
  <p><strong>abc.sh</strong></p>
  
  <pre><code>#!bin/sh
  
  ls
  cat /abc.sh
  </code></pre>
  
  <p>Also, <code>docker-compose up</code> is giving me no error. Output looks like</p>
  
  <pre><code>Raghav-Macbook:drupal-docker raghav$ docker-compose up
  Recreating drupaldocker_myapp_1
  Attaching to drupaldocker_myapp_1 
  myapp_1  | oot  etc   lib    media  opt root  sbin  sys  usr
  myapp_1  | bin  dev   home  lib64  mnt    proc  run   srv   tmp  var
  myapp_1  | #!bin/sh 
  myapp_1  | 
  myapp_1  | ls
  </code></pre>
  
  <p>What changes should I do to make this work?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Output of <code>docker logs drupaldocker_myapp_1</code></p>
  
  <pre><code>abc.sh  boot  etc   lib    media  opt   root  sbin  sys  usr
  bin dev   home  lib64  mnt    proc  run   srv   tmp  var 
  #!bin/sh
  
  ls
  cat /abc.shabc.sh   boot  etc   lib    media  opt   root  sbin  sys  usr
  bin dev   home  lib64  mnt    proc  run   srv   tmp  var
  #!bin/sh
  
  ls
  cat /abc.sh
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Does a container gets stopped once the entrypoint script is executed?</p>