Use /var/lib/ocis as a working dir (based on https://github.com/owncloud/ocis/blob/master/ocis/docker/Dockerfile.linux.amd64)
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2024-11-08 15:00:31 +01:00
parent 9afd9241e6
commit c295eb69b0

View File

@@ -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 <devops@owncloud.com>" \
@@ -43,8 +43,23 @@ LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
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