Skip to content

cron won't run inside server container with custom uid #1899

@meonkeys

Description

@meonkeys

I set up cron following https://github.com/nextcloud/docker/tree/master/.examples/dockerfiles/cron/apache . This has been working well for a while now. Just now I tried running my Nextcloud container as a non-root user (following #1812) and I'm getting an error from the container:

crond: can't set groups: Operation not permitted

Here's my Dockerfile:

FROM nextcloud:25.0.2-apache

RUN apt-get update \
  && apt-get install -y --no-install-recommends \
    supervisor \
    ffmpeg \
    ghostscript \
    libmagickcore-6.q16-6-extra \
  && rm -rf /var/lib/apt/lists/* \
  && mkdir /var/log/supervisord /var/run/supervisord \
  && sed -i '/^.\+coder.\+PDF.\+$/s/none/read | write/' /etc/ImageMagick-6/policy.xml

COPY supervisord.conf /

# Avoid permission error later. This is likely suboptimal but it seems to work.
# The error is: PermissionError: [Errno 13] Permission denied: '/var/log/supervisord/supervisord.log'
RUN chown -R www-data:www-data /var/log/supervisord /var/run/supervisord

ENV NEXTCLOUD_UPDATE=1

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]

My workaround is to run the container as root.

See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions