From 75bc830def3cb6a2a3e182e0f6852d2bb53d6fc2 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Thu, 18 Feb 2021 10:07:59 +0100 Subject: [PATCH] simplified tor image --- tor/Dockerfile | 19 +++++++++++++------ tor/entrypoint.sh | 14 -------------- 2 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 tor/entrypoint.sh 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 "$@"