mirror of
https://github.com/MrUnknownDE/tor-relay-docker.git
synced 2026-04-19 14:53:51 +02:00
feat: use linuxserver.io alpine image
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -1,34 +1,33 @@
|
|||||||
FROM alpine:3.10
|
FROM lsiobase/alpine:3.10
|
||||||
|
|
||||||
LABEL maintainer "Nicolas Coutin <ilshidur@gmail.com>"
|
LABEL maintainer "Nicolas Coutin <ilshidur@gmail.com>"
|
||||||
|
|
||||||
|
ARG DEBIAN_FRONTEND="noninteractive"
|
||||||
|
ENV XDG_DATA_HOME="/config" \
|
||||||
|
XDG_CONFIG_HOME="/config"
|
||||||
|
ENV TZ America/Los_Angeles
|
||||||
|
|
||||||
RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
|
RUN sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk --no-cache add bash tzdata tor
|
RUN apk --no-cache add bash tzdata tor
|
||||||
ENV TZ America/Los_Angeles
|
|
||||||
|
|
||||||
EXPOSE 9001
|
EXPOSE 9001 9030
|
||||||
|
|
||||||
|
# TOR configuration through environment variables.
|
||||||
ENV RELAY_TYPE relay
|
ENV RELAY_TYPE relay
|
||||||
ENV TOR_ORPort 9001
|
ENV TOR_ORPort 9001
|
||||||
ENV TOR_DataDirectory /var/lib/tor
|
ENV TOR_DataDirectory /data
|
||||||
ENV TOR_ContactInfo "Random Person nobody@tor.org"
|
ENV TOR_ContactInfo "Random Person nobody@tor.org"
|
||||||
ENV TOR_RelayBandwidthRate "100 KBytes"
|
ENV TOR_RelayBandwidthRate "100 KBytes"
|
||||||
ENV TOR_RelayBandwidthBurst "200 KBytes"
|
ENV TOR_RelayBandwidthBurst "200 KBytes"
|
||||||
|
|
||||||
COPY torrc.bridge.default /etc/tor/torrc.bridge.default
|
# Copy the default configurations.
|
||||||
COPY torrc.relay.default /etc/tor/torrc.relay.default
|
COPY torrc.bridge.default /config/torrc.bridge.default
|
||||||
COPY torrc.exit.default /etc/tor/torrc.exit.default
|
COPY torrc.relay.default /config/torrc.relay.default
|
||||||
|
COPY torrc.exit.default /config/torrc.exit.default
|
||||||
RUN chown -R tor /etc/tor
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod ugo+rx /entrypoint.sh
|
RUN chmod ugo+rx /entrypoint.sh
|
||||||
|
|
||||||
USER tor
|
COPY /root /
|
||||||
|
VOLUME /data
|
||||||
RUN mkdir /var/lib/tor/.tor
|
|
||||||
VOLUME /var/lib/tor/.tor
|
|
||||||
RUN chown -R tor /var/lib/tor/.tor
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# tor-relay-docker
|
# tor-relay-docker
|
||||||
|
|
||||||
Lightweight TOR relay image, based on Alpine Linux. Configurations can be passed as environment variables.
|
Lightweight TOR relay image, based on [LinuxServer.io Alpine Linux](https://linuxserver.io). Configurations can be passed as environment variables.
|
||||||
|
|
||||||
[](https://hub.docker.com/r/ilshidur/tor-relay)
|
[](https://hub.docker.com/r/ilshidur/tor-relay)
|
||||||
|
|
||||||
@@ -18,6 +18,8 @@ docker run \
|
|||||||
-e TOR_RelayBandwidthRate="100 KBytes" \
|
-e TOR_RelayBandwidthRate="100 KBytes" \
|
||||||
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
||||||
-e TZ=Europe/London \
|
-e TZ=Europe/London \
|
||||||
|
-e PUID=$(id -u) \
|
||||||
|
-e PGID=$(id -g) \
|
||||||
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
||||||
-p 9001:9001 \
|
-p 9001:9001 \
|
||||||
--restart always \
|
--restart always \
|
||||||
@@ -36,6 +38,8 @@ docker run \
|
|||||||
-e TOR_RelayBandwidthRate="100 KBytes" \
|
-e TOR_RelayBandwidthRate="100 KBytes" \
|
||||||
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
||||||
-e TZ=Europe/London \
|
-e TZ=Europe/London \
|
||||||
|
-e PUID=$(id -u) \
|
||||||
|
-e PGID=$(id -g) \
|
||||||
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
||||||
-p 9001:9001 \
|
-p 9001:9001 \
|
||||||
--restart always \
|
--restart always \
|
||||||
@@ -54,6 +58,8 @@ docker run \
|
|||||||
-e TOR_RelayBandwidthRate="100 KBytes" \
|
-e TOR_RelayBandwidthRate="100 KBytes" \
|
||||||
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
-e TOR_RelayBandwidthBurst="200 KBytes" \
|
||||||
-e TZ=Europe/London \
|
-e TZ=Europe/London \
|
||||||
|
-e PUID=$(id -u) \
|
||||||
|
-e PGID=$(id -g) \
|
||||||
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
-v $(pwd)/tor/data:/var/lib/tor:Z \
|
||||||
-p 9001:9001 \
|
-p 9001:9001 \
|
||||||
--restart always \
|
--restart always \
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
env | grep '^TOR_' | tr "=" " " | cut -c 5- > /etc/tor/torrc
|
env | grep '^TOR_' | tr "=" " " | cut -c 5- > /config/torrc
|
||||||
|
|
||||||
exec tor -f /etc/tor/torrc --defaults-torrc "/etc/tor/torrc.${RELAY_TYPE}.default"
|
exec tor -f /config/torrc --defaults-torrc "/config/torrc.${RELAY_TYPE}.default"
|
||||||
|
|||||||
5
root/etc/cont-init.d/30-config
Normal file
5
root/etc/cont-init.d/30-config
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
chown -R abc:abc \
|
||||||
|
/data \
|
||||||
|
/config
|
||||||
5
root/etc/services.d/tor/run
Normal file
5
root/etc/services.d/tor/run
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
exec \
|
||||||
|
s6-setuidgid abc /entrypoint.sh "${RUN_OPTS}"
|
||||||
|
|
||||||
Reference in New Issue
Block a user