Docker CRON container mapping issues for Weathermaps

Hi All

I am running the latest version of Librenms in Docker and am looking at enabling Weathermaps. I need to add a CRON entry to run map-poller.php every few minutes. If Librenms was installed just on the host it would be very easy to update the CRON to execute but am wondering the best way to update CRON when using Docker?

I think I need to map a CRON entry from the host into the librenms container at /var/spool/cron/crontabs but when I try and change anything in that directory via Dockerfile I see no changes been made. I know I am building the Dockerfile correctly as can see other changes (in other folders) reflected fine. I am wondering if it might be a permissions issue but not sure where.

In the Dockerfile I have tried:

Adding the cron file for root and mapping it into the container:
ADD root /var/spool/cron/crontabs/root

Changing the ownership of the /var/spool/cron/crontabs folder:
RUN chmod -R 777 /var/spool/cron/crontabs

‘Touching’ a new file in /var/spool/cron/crontabs
RUN touch root /var/spool/cron/crontabs

Doesn’t seem to matter what I do in the Dockerfile I cannot get anything to stick in /var/spool/cron/crontabs

Appreciate any help on this, have any of you done anything similar ?


This topic was automatically closed 186 days after the last reply. New replies are no longer allowed.