diff --git a/tor/Dockerfile b/tor/Dockerfile index c00853e..b9d94ca 100644 --- a/tor/Dockerfile +++ b/tor/Dockerfile @@ -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 diff --git a/tor/entrypoint.sh b/tor/entrypoint.sh deleted file mode 100644 index b5c5759..0000000 --- a/tor/entrypoint.sh +++ /dev/null @@ -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 "$@"