mirror of
https://git.mills.io/prologic/zs
synced 2024-11-24 06:16:32 +03:00
Fix Docker image to work with rootless Docker environments
This commit is contained in:
parent
b137b085d4
commit
a69c3f300c
@ -1,9 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ -n "${PUID}" ] && usermod -u "${PUID}" zs
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
[ -n "${PGID}" ] && groupmod -g "${PGID}" zs
|
[ -n "${PUID}" ] && usermod -u "${PUID}" nobody
|
||||||
|
[ -n "${PGID}" ] && groupmod -g "${PGID}" nobody
|
||||||
|
fi
|
||||||
|
|
||||||
printf "Configuring zs...\n"
|
printf "Configuring zs...\n"
|
||||||
|
|
||||||
printf "Switching UID=%s and GID=%s\n" "${PUID}" "${PGID}"
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
exec su-exec zs:zs "$@"
|
printf "Switching UID=%s and GID=%s\n" "$(id -u nobody)" "$(id -g nobody)"
|
||||||
|
exec su-exec nobody:nobody "$@"
|
||||||
|
else
|
||||||
|
exec zs "$@"
|
||||||
|
fi
|
||||||
|
@ -50,9 +50,7 @@ RUN apk --no-cache -U add su-exec shadow tzdata ca-certificates curl jq
|
|||||||
ENV PUID=1000
|
ENV PUID=1000
|
||||||
ENV PGID=1000
|
ENV PGID=1000
|
||||||
|
|
||||||
RUN addgroup -g "${PGID}" zs && \
|
RUN mkdir -p /data && chown -R nobody:nobody /data
|
||||||
adduser -D -H -G zs -h /var/empty -u "${PUID}" zs && \
|
|
||||||
mkdir -p /data && chown -R zs:zs /data
|
|
||||||
|
|
||||||
EXPOSE 8000/tcp
|
EXPOSE 8000/tcp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user