title: Why docker container always restarting?
body: <p>I run a container in the background using:</p>
  
  <pre><code>docker run --restart always --name lnmp -v /Users/gedongdong/web:/var/www/ -itd lnmp
  </code></pre>
  
  <p>dockerfile:</p>
  
  <pre><code>FROM alpine:edge
  LABEL author=gedongdong2010@163.com
  
  RUN mkdir -p /run/nginx &amp;&amp; mkdir -p /shell
  
  RUN echo http://mirrors.aliyun.com/alpine/edge/main &gt; /etc/apk/repositories &amp;&amp; \
  echo http://mirrors.aliyun.com/alpine/edge/community &gt;&gt; /etc/apk/repositories &amp;&amp; \
  apk update &amp;&amp; apk add --no-cache nginx
  
  COPY vhosts.conf /etc/nginx/conf.d/
  COPY start.sh /shell
  RUN chmod -R 777 /shell
  
  
  EXPOSE 80 443 6379
  
  CMD ["/shell/start.sh"]
  </code></pre>
  
  <p>start.sh:</p>
  
  <pre><code>nginx -c /etc/nginx/nginx.conf
  tail -f /dev/null
  </code></pre>
  
  <p>vhosts.conf:</p>
  
  <pre><code> server {
      listen 80;
      server_name docker.test;
      root /var/www;
      index index.html;
  }
  </code></pre>
  
  <p>when i use <code>docker ps -a</code>:</p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                          PORTS               NAMES
  3a3910c0dc29        lnmp                "/shell/start.sh"   16 minutes ago      Restarting (1) 50 seconds ago                       lnmp
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6P6e8.png" rel="nofollow noreferrer">docker ps -a</a>
  Why is my container always restarting?</p>