From ed6c8194a7c3af2915545688a28f29a2f70fbbe0 Mon Sep 17 00:00:00 2001 From: DDS-Tomo <108336573+DDS-ALL@users.noreply.github.com> Date: Wed, 28 Dec 2022 17:18:27 +0800 Subject: [PATCH] feat: add `PUID`, `PGID`, `Umask` settings to docker image (close #2525 pr #2818) Co-authored-by: DDSRem <1448139087@qq.com> --- Dockerfile | 6 ++++-- entrypoint.sh | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index b41b005f..dd709a63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ LABEL MAINTAINER="i@nn.ci" VOLUME /opt/alist/data/ WORKDIR /opt/alist/ COPY --from=builder /app/bin/alist ./ -RUN apk add ca-certificates +COPY entrypoint.sh /entrypoint.sh +RUN apk add ca-certificates bash su-exec +ENV PUID=1000 PGID=1000 UMASK=022 EXPOSE 5244 -CMD [ "./alist", "server", "--no-prefix" ] \ No newline at end of file +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..05bbf8d3 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +chown -R ${PUID}:${PGID} /opt/alist/ + +umask ${UMASK} + +exec su-exec ${PUID}:${PGID} ./alist server --no-prefix \ No newline at end of file