title: Why doesn't the cron service in Dockerfile run?
body: <p>While <a href="https://stackoverflow.com/questions/20545554/how-do-i-start-cron-on-docker-ubuntu-base">searching</a> for this issue I found that: <code>cron -f</code> should start the service.</p>
  
  <p>So I have:<br>
  <code>RUN apt-get install -qq -y git cron</code></p>
  
  <p>Next I have:<br>
  <code>CMD cron -f &amp;&amp; crontab -l &gt; pullCron &amp;&amp; echo "* * * * * git -C ${HOMEDIR} pull" &gt;&gt; pullCron &amp;&amp; crontab pullCron &amp;&amp; rm pullCron</code></p>
  
  <p>My dockerfile deploys without errors but the cron doesn't run. What can I do to start the cron service with an added line?</p>
  
  <p>PS:<br>
  I know that the git function in my cron should actually be a hook, but for me (and probably for others) this is about learning how to set crons with Docker :-)</p>
  
  <p>PPS:<br>
  Complete Dockerfile (UPDATED):<br></p>
  
  <pre><code>RUN apt-get update &amp;&amp; apt-get upgrade -y
  RUN mkdir -p /var/log/supervisor
  RUN apt-get install -qq -y nginx git supervisor cron wget
  RUN echo "daemon off;" &gt;&gt; /etc/nginx/nginx.conf
  RUN wget -O ./supervisord.conf https://raw.githubusercontent.com/..../supervisord.conf
  RUN mv ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  RUN apt-get install software-properties-common -y &amp;&amp; apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 &amp;&amp; add-apt-repository 'deb http://dl.hhvm.com/ubuntu utopic main' &amp;&amp; apt-get update &amp;&amp; apt-get install hhvm -y
  RUN cd ${HOMEDIR} &amp;&amp; git clone ${GITDIR} &amp;&amp; mv ./tybalt/* ./ &amp;&amp; rm -r ./tybalt &amp;&amp; git init
  RUN echo "* * * * * 'cd ${HOMEDIR} &amp;&amp; /usr/bin/git pull origin master'" &gt;&gt; pullCron &amp;&amp; crontab pullCron &amp;&amp; rm pullCron
  EXPOSE 80
  CMD ["/usr/bin/supervisord"]
  </code></pre>
  
  <p>PPPS:<br>
  Supervisord.conf:<br></p>
  
  <pre><code>[supervisord]
  autostart=true
  autorestart=true
  nodaemon=true
  
  [program:nginx]
  command=/usr/sbin/nginx -c /etc/nginx/nginx.conf
  
  [program:cron]
  command = cron -f -L 15
  autostart=true
  autorestart=true
  </code></pre>