Skip to content

Commit

Permalink
fix(ci): permission of alist binary in docker; entrypoint logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmx233 committed Dec 30, 2024
1 parent 6544061 commit d2236af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ RUN apk update && \

COPY --from=builder /app/bin/alist ./
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && /entrypoint.sh version
RUN chmod +x /opt/alist/alist && \
chmod +x /entrypoint.sh && /entrypoint.sh version

ENV PUID=0 PGID=0 UMASK=022 RUN_ARIA2=${INSTALL_ARIA2}
VOLUME /opt/alist/data/
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN apk update && \

COPY /build/${TARGETPLATFORM}/alist ./
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && /entrypoint.sh version
RUN chmod +x /opt/alist/alist && \
chmod +x /entrypoint.sh && /entrypoint.sh version

ENV PUID=0 PGID=0 UMASK=022 RUN_ARIA2=${INSTALL_ARIA2}
VOLUME /opt/alist/data/
Expand Down
20 changes: 10 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

chown -R ${PUID}:${PGID} /opt/alist/

umask ${UMASK}

if [ "$RUN_ARIA2" = "true" ]; then
exec su-exec ${PUID}:${PGID} nohup aria2c \
--enable-rpc \
--rpc-allow-origin-all \
--conf-path=/root/.aria2/aria2.conf \
>/dev/null 2>&1 &
fi

if [ "$1" = "version" ]; then
./alist version
else
chown -R ${PUID}:${PGID} /opt/alist/

if [ "$RUN_ARIA2" = "true" ]; then
exec su-exec ${PUID}:${PGID} nohup aria2c \
--enable-rpc \
--rpc-allow-origin-all \
--conf-path=/root/.aria2/aria2.conf \
>/dev/null 2>&1 &
fi

exec su-exec ${PUID}:${PGID} ./alist server --no-prefix
fi

0 comments on commit d2236af

Please sign in to comment.