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...

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay