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
COPY entrypoint.sh /entrypoint
RUN chmod +x entrypoint
ENTRYPOINT ["/entrypoint"]
CMD ["tor"]
RUN addgroup --gid 10001 tor && \
adduser \
--uid 10000 \
--home /var/lib/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 "$@"