From a26ccd956ce6f05f4787722854f783d55313693e Mon Sep 17 00:00:00 2001 From: Ilia Burakov Date: Sat, 23 Mar 2024 14:05:25 -0400 Subject: [PATCH] add clean-up --- ubuntu_lts_repo/Dockerfile | 4 ++++ ubuntu_rolling_sources/Dockerfile | 5 +++++ ubuntu_rolling_sources/VersionInfo.Dockerfile | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/ubuntu_lts_repo/Dockerfile b/ubuntu_lts_repo/Dockerfile index f0ede3f..f894af8 100644 --- a/ubuntu_lts_repo/Dockerfile +++ b/ubuntu_lts_repo/Dockerfile @@ -7,6 +7,10 @@ ARG VERSION RUN apt-get update && \ apt-get install -y curl tor tor-geoipdb obfs4proxy && \ + # cleanup + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + # 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}') && \ diff --git a/ubuntu_rolling_sources/Dockerfile b/ubuntu_rolling_sources/Dockerfile index 899cad5..41e83ea 100644 --- a/ubuntu_rolling_sources/Dockerfile +++ b/ubuntu_rolling_sources/Dockerfile @@ -54,9 +54,14 @@ RUN apt-get update && \ cp obfs4proxy /usr/bin/obfs4proxy && \ chmod +x /usr/bin/obfs4proxy && \ # cleanup + go clean -modcache -cache -testcache -fuzzcache && \ + rm -rf ~/go && \ + rm -rf ~/.cache && \ apt-get remove -y golang git build-essential automake libevent-dev libssl-dev zlib1g-dev && \ apt-get autoremove -y && \ apt-get install -y libc6 libcap2 libevent-dev liblzma5 libseccomp2 libssl3 libsystemd0 libzstd1 zlib1g adduser lsb-base && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ rm -rf ~/git && \ # check versions ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ diff --git a/ubuntu_rolling_sources/VersionInfo.Dockerfile b/ubuntu_rolling_sources/VersionInfo.Dockerfile index e83ace5..6f472ac 100644 --- a/ubuntu_rolling_sources/VersionInfo.Dockerfile +++ b/ubuntu_rolling_sources/VersionInfo.Dockerfile @@ -5,24 +5,35 @@ FROM ubuntu:rolling RUN apt-get update && \ apt-get install -y git && \ mkdir -p ~/git && \ + # get tor cd ~/git && \ git clone https://gitlab.torproject.org/tpo/core/tor.git && \ cd ~/git/tor && \ git fetch --tags && \ torLatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ + # get webtunnel cd ~/git && \ git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/webtunnel.git && \ cd ~/git/webtunnel/main/client && \ webtunnelCommitHash=$(git rev-parse --short HEAD) && \ + # get snowflake cd ~/git && \ git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git && \ cd ~/git/snowflake/ && \ snowflakeCommitHash=$(git rev-parse --short HEAD) && \ + # get obfs4proxy cd ~/git && \ git clone https://gitlab.com/yawning/obfs4.git && \ cd ~/git/obfs4 && \ git fetch --tags && \ obfs4LatestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") && \ + # cleanup + apt-get remove -y git && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf ~/git && \ + # write version info ubuntu_version=$(cat /etc/os-release | grep VERSION_ID | awk -F '"' '{print $2}') && \ torLatestTag=$(echo $torLatestTag | sed 's/.*-//') && \ obfs4LatestTag=$(echo $obfs4LatestTag | sed 's/.*-//') && \