I want to run docker by docker run
command and want to pass crontab command like bleow.
crontab -l | '{ /bin/cat; /bin/echo "*/5 * * * * <some command>"; }' | crontab -
The above command will create a cronscript which will run every 5 mins inside the new created docker container.
I dont need to supply this command when building image. *This docker will be created when job is scheduled.
docker run -it image /bin/bash -c "crontab -l | /bin/cat; /bin/echo \"*/5 * * * * <some command>\" |crontab - ; service cron restart"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With