# Cron + docker container

**URL:** <https://forums.docker.com/t/cron-docker-container/33542>\
**Category:** General\
**Created:** [June 13, 2017, 5:34pm UTC](https://forums.docker.com/t/cron-docker-container/33542 "2017-06-13T17:34:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrandersen7](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mrandersen7](https://forums.docker.com/u/mrandersen7)\
**Post date:** [June 13, 2017, 5:34pm UTC](https://forums.docker.com/t/cron-docker-container/33542/1 "2017-06-13T17:34:49Z")

</div>

Hi! I am sorry, if this place is not the correct one for this question.

I have docker-container, one of 5 containers. I run cron commands there, and cron jobs are volumed to the container.

FROM php:7.1.5-cli  
RUN echo “deb [http://httpredir.debian.org/debian](http://httpredir.debian.org/debian) experimental main” \>\> /etc/apt/sources.list  
RUN apt-get update  
RUN apt-get install -y cron curl zip unzip g++  
RUN apt-get -t experimental install -y libicu-dev  
RUN docker-php-ext-install pdo\_mysql intl opcache  
RUN mkdir /var/log/cron  
ADD ./docker/cron/jobs.txt /cron.txt  
RUN crontab /cron.txt  
CMD [“cron”, “-f”]

Everything is ok. BUT when i change jobs from host (manually or by calling git pull and fetching new ones from repo) file itself updates, but cron -l shows old one. Thats ok i assume, until i restart cron, BUT even when i do so by calling docker-compose rm cron, or just docker-compose restart cron, nothing happens i still see old cron within cron -l command, but file itself is updated, what am i doing wrong?

Docker on windows 10 Docker version 17.03.1-ce, build c6d412e
