Hi
Is there way to run a shell script in a running container so that I could populate some data?
I try cronjob but not able to do. Seem not supported.
Many thanks
Hi
Is there way to run a shell script in a running container so that I could populate some data?
I try cronjob but not able to do. Seem not supported.
Many thanks
Running cronjobs inside container depends on system in image which runs in container. For eg. Pihole container has cron service running on start which runs scheduled cronjob that updates adlists along with other services (daemons) needed for functionality.
System in docker container does not boots as system installed on machine which starts init process (which has its config/scripts to start services) after kernel is started. In container init process is not executed on start, container runs CMD/ENTRYPOINT command on start, which can be some init script that runs multiple services in container if image is crafted like that. See more how to create docker image to run cron at https://www.baeldung.com/ops/docker-cron-job, maybe there are some already available images like this, search docker hub for it.