Skip to content

zwiazeksyndykalistowpolski/docker-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Docker image

Docker client + crontab + make + bash Allows to execute scheduled tasks inside other containers by passing access to docker socket.

Instruction

  1. Put your crontab file to the /root/cron by mounting a volume or by adding a file to the container.

    Example crontab file:

    15 3 * * * cd /var/project && make task_clear_cache
    
  2. Run the container granting access to the docker socket

    sudo docker run --rm --name cron -v /var/run/docker.sock:/var/run/docker.sock -v ./cron:/root/cron wolnosciowiec/docker-cron:latest
  3. That's all!