simplified tor image

main
Ricard Illa 2021-02-18 10:07:59 +01:00
parent b89904e84f
commit 75bc830def
2 changed files with 13 additions and 20 deletions

View File

@ -1,7 +1,14 @@
FROM alpine:3.12 FROM alpine:3.13
RUN apk add --no-cache tor su-exec shadow RUN addgroup --gid 10001 tor && \
COPY entrypoint.sh /entrypoint adduser \
RUN chmod +x entrypoint --uid 10000 \
ENTRYPOINT ["/entrypoint"] --home /var/lib/tor \
CMD ["tor"] --ingroup tor \
--disabled-password \
--shell /sbin/nologin \
tor && \
apk add --no-cache tor
USER tor
CMD tor

View File

@ -1,14 +0,0 @@
#!/bin/sh
set -xe
[ -n "${USER_ID}" ] && usermod -u "${USER_ID}" tor
for dir in $(awk '{if ($1 == "HiddenServiceDir") print $2}' /etc/tor/torrc)
do
mkdir -p "${dir}"
chown tor "${dir}"
chmod 700 "${dir}"
done
su-exec tor "$@"