From c295eb69b004b643d497294a9bf1a03a54be7a12 Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Fri, 8 Nov 2024 15:00:31 +0100 Subject: [PATCH] Use /var/lib/ocis as a working dir (based on https://github.com/owncloud/ocis/blob/master/ocis/docker/Dockerfile.linux.amd64) --- Dockerfile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2aa8adf..d56cd97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN make ci-go-generate build ENABLE_VIPS=true FROM alpine:3.20 -RUN apk add --no-cache attr ca-certificates curl mailcap tree vips && \ +RUN apk add --no-cache attr ca-certificates curl inotify-tools libc6-compat mailcap tree vips && \ echo 'hosts: files dns' >| /etc/nsswitch.conf LABEL maintainer="ownCloud GmbH " \ @@ -43,8 +43,23 @@ LABEL maintainer="ownCloud GmbH " \ org.label-schema.vendor="ownCloud GmbH" \ org.label-schema.schema-version="1.0" +RUN addgroup -g 1000 -S ocis-group && \ + adduser -S --ingroup ocis-group --uid 1000 ocis-user --home /var/lib/ocis && \ + mkdir -p /var/lib/ocis && \ + chown -R ocis-user:ocis-group /var/lib/ocis && \ + chmod -R 751 /var/lib/ocis && \ + mkdir -p /etc/ocis && \ + chown -R ocis-user:ocis-group /etc/ocis && \ + chmod -R 751 /etc/ocis + +VOLUME [ "/var/lib/ocis", "/etc/ocis" ] +WORKDIR /var/lib/ocis + +USER 1000 + +EXPOSE 9200/tcp + ENTRYPOINT ["/usr/bin/ocis"] CMD ["server"] -COPY --from=build /ocis/ocis/bin/ocis /usr/bin/ocis - +COPY --from=build /ocis/ocis/bin/ocis /usr/bin/ocis \ No newline at end of file