I want to schedule a job in a docker container. First of all after looking around i could stablish the container time zone correctly. When i use the command 'date' inside the terminal, it shows the hour of my city and country, but the cronjob works with the time zone that was especified by default in the container. I readed that it's necesary to tell cron, that the time zone has changed. I tried and environment variable TZ_CRON but it didnt work.I also restarted the cron service inside the container but it continued working in the same way.
I base my code in this repo https://github.com/senorihl/docker-compose-cronjob Then i sync the timezone with the command:
environment:
- TZ=America/Bogota
command: >
sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &&
echo $TZ > /etc/timezone"
entrypoint: sh /app/crontab.sh
Can you please help me with this?