mirror of
https://github.com/wushuo894/ani-rss.git
synced 2026-03-13 09:20:23 +00:00
测试指定权限执行
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
FROM ibm-semeru-runtimes:open-17-jre
|
||||
|
||||
# Install latest su-exec
|
||||
RUN set -ex; \
|
||||
\
|
||||
curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
|
||||
\
|
||||
fetch_deps='gcc libc-dev'; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends $fetch_deps; \
|
||||
rm -rf /var/lib/apt/lists/*; \
|
||||
gcc -Wall \
|
||||
/usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
|
||||
chown root:root /usr/local/bin/su-exec; \
|
||||
chmod 0755 /usr/local/bin/su-exec; \
|
||||
rm /usr/local/bin/su-exec.c; \
|
||||
\
|
||||
apt-get purge -y --auto-remove $fetch_deps
|
||||
|
||||
COPY docker/run.sh /run.sh
|
||||
COPY docker/exec.sh /exec.sh
|
||||
COPY target/ani-rss-jar-with-dependencies.jar /usr/app/ani-rss-jar-with-dependencies.jar
|
||||
WORKDIR /usr/app
|
||||
VOLUME /config
|
||||
ENV PORT="7789"
|
||||
ENV CONFIG="/config"
|
||||
ENV TZ="Asia/Shanghai"
|
||||
ENV PUID=0 PGID=0 UMASK=022
|
||||
ENV PORT=7789 CONFIG=/config TZ=Asia/Shanghai
|
||||
EXPOSE $PORT
|
||||
RUN chmod +x /run.sh
|
||||
CMD ["/run.sh"]
|
||||
RUN chmod +x /exec.sh /run.sh
|
||||
CMD ["/exec.sh"]
|
||||
|
||||
7
docker/exec.sh
Normal file
7
docker/exec.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
chown -R ${PUID}:${PGID} /usr/app
|
||||
|
||||
umask ${UMASK}
|
||||
|
||||
exec su-exec ${PUID}:${PGID} /run.sh
|
||||
Reference in New Issue
Block a user