Попробуйте что-нибудь вроде этого,
FROM ubuntu:latestMAINTAINER docker@ekito.frRUN apt-get update && apt-get -y install cron# Add crontab file in the cron directoryADD crontab /etc/cron.d/hello-cron# Give execution rights on the cron jobRUN chmod 0644 /etc/cron.d/hello-cron# Apply cron jobRUN crontab /etc/cron.d/hello-cron# Create the log file to be able to run tailRUN touch /var/log/cron.log# Run the command on container startupCMD cron && tail -f /var/log/cron.log
создайте файл crontab и добавьте запись, подобную этой
* * * * * root echo "Hello world" >> /var/log/cron.log 2>&1
Надеюсь, это вам поможет!!!