DEV Community

Vladislav Kopylov
Vladislav Kopylov

Posted on

How to run CRON with Docker in alpine

In my job, we are using alpine docker images for each application. In order to implement new feature we have installed CRON in a docker image. We have noticed that CRON does not work. In logs we saw the error:

crond: can't set groups: Operation not permitted
Enter fullscreen mode Exit fullscreen mode

It was unusual bug. I have found that in alpine CRON must be running as the root privilege. It's harmful for security concerns. In order to run CRON as the normal user privilege there are two solutions:

  1. Using geekidea/alpine-cron docker images
  2. Choose another linux distributive

The choice is yours...

Top comments (0)