Skip to content

Permission errors with docker bind mounts #2110

@adamu

Description

@adamu

I am trying to run the official Docker image.

I am not using docker compose (I'm using the Synology Container Manager).

When I try to run the image, I receive errors because the app running as 1000:1000 does not have permission to write to the mounted /var/lib/radicale directory, which is not owned by 1000:1000.

Radicale/Dockerfile

Lines 20 to 24 in ab71a12

RUN addgroup -g 1000 radicale \
&& adduser radicale --home /var/lib/radicale --system --uid 1000 --disabled-password -G radicale \
&& apk add --no-cache ca-certificates openssl curl git
COPY --chown=radicale:radicale --from=builder /app/venv /app

I have worked around this by building my own version of the image with the UID and GID set to the same as the host filesystem.

ARG UID
ARG GID
RUN addgroup -g $GID radicale \
    && adduser radicale --home /var/lib/radicale --system --uid $UID --disabled-password -G radicale \
    && apk add --no-cache ca-certificates openssl curl git

If I do not mount a directory to /var/lib/radicale, the container starts. But then I believe the data will be lost when the container is stopped or replaced with a later version. The synology does not provide an option to change the UID/GID of the mounted directory.

Perhaps the official image could be modified to allow for the user to be specified at runtime?

Metadata

Metadata

Assignees

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