-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG BUILD_PLATFORM | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
ARG VERSION | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl tor tor-geoipdb obfs4proxy && \ | ||
# check versions | ||
tor_version=$(apt-cache madison tor | awk '{print $3; exit}') && \ | ||
obfs4proxy_version=$(apt-cache madison obfs4proxy | awk '{print $3; exit}') && \ | ||
ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ | ||
actualVersion="ubuntu_lts_${ubuntu_version}_tor_${tor_version}_obfs4proxy_${obfs4proxy_version}" && \ | ||
if [ "$actualVersion" != "$VERSION" ]; then echo "Version mismatch: argument $VERSION, actual $actualVersion" && exit 1; fi && \ | ||
# cleanup | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
EXPOSE 9050 | ||
|
||
HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ | ||
CMD curl -x socks5h://127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '"IsTor"\s*:\s*true' | ||
|
||
VOLUME ["/var/lib/tor"] | ||
CMD ["tor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && \ | ||
tor_version=$(apt-cache madison tor | awk '{print $3; exit}') && \ | ||
obfs4proxy_version=$(apt-cache madison obfs4proxy | awk '{print $3; exit}') && \ | ||
ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ | ||
echo "ubuntu_lts_${ubuntu_version}_tor_${tor_version}_obfs4proxy_${obfs4proxy_version}" > /version.txt | ||
|
||
CMD cat /version.txt |