summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-02-18 16:36:19 -0700
committermo khan <mo.khan@gmail.com>2020-02-18 16:36:19 -0700
commitcaf158202ad7efa7178c4d82a6f20bd393d67005 (patch)
tree25be430c75d613cb15fd3bde4aa868582fb7e5b3
parent0c1499a71aed88967314ccc1b611081030cd5e8f (diff)
Extract function to scrub files
-rw-r--r--Dockerfile24
-rw-r--r--config/.bashrc17
-rw-r--r--config/02nocache4
3 files changed, 21 insertions, 24 deletions
diff --git a/Dockerfile b/Dockerfile
index f16702b..d72b8dc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,12 +17,8 @@ ENV PATH="${PATH}:/root/.asdf/shims:/root/.asdf/bin"
ENV TERM="xterm"
ENV HOME=/root
WORKDIR $HOME
-COPY config/* /root/
-#COPY config/NuGet /root/.config/NuGet
-#COPY config/gradle /root/.gradle
+COPY config /root
RUN mv /root/01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc && \
- mv /root/02nocache /etc/apt/apt.conf.d/02nocache && \
- mkdir -p /root/.deb/cache /root/.deb/archives && \
apt-get update -q && apt-get install -y --no-install-recommends \
apt-transport-https \
apt-utils \
@@ -83,21 +79,11 @@ RUN mv /root/01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc && \
&& asdf plugin-add python \
&& asdf plugin-add ruby \
&& bash $HOME/.asdf/plugins/nodejs/bin/import-release-team-keyring \
- && asdf install && asdf current \
- && rm -fr $HOME/.asdf/installs/**/**/share \
- && rm -fr $HOME/.asdf/installs/java/**/man \
- && rm -fr $HOME/.asdf/installs/python/**/lib/**/test \
- && rm -fr /*.deb \
- && rm -fr /*.deb \
- && rm -fr /usr/share/doc/ \
- && rm -fr /usr/share/doc/ \
- && rm -fr /usr/share/dotnet/sdk/NuGetFallbackFolder \
- && rm -fr /var/cache/apt/archives/ \
- && rm -fr /var/cache/apt/archives/ \
- && rm -fr /var/lib/apt/lists/* \
- && rm -fr /var/lib/apt/lists/* \
+ && bash -lc 'scrub'
+RUN asdf install && asdf current \
&& rm -fr /tmp \
- && mkdir -p /tmp
+ && mkdir -p /tmp \
+ && bash -lc 'scrub'
COPY --from=gem-builder /opt/license-management/*.gem $LM_HOME/
COPY test /test
COPY run.sh /
diff --git a/config/.bashrc b/config/.bashrc
index 56311aa..089da71 100644
--- a/config/.bashrc
+++ b/config/.bashrc
@@ -2,9 +2,9 @@ export BUNDLE_JOBS=8
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export HISTFILESIZE=0
export HISTSIZE=0
-export LANG=en_US.UTF-8
-export LANGUAGE=en_US:en
-export LC_ALL=en_US.UTF-8
+#export LANG=en_US.UTF-8
+#export LANGUAGE=en_US:en
+#export LC_ALL=en_US.UTF-8
export RUBY_GC_HEAP_INIT_SLOTS=800000
export RUBY_GC_MALLOC_LIMIT=79000000
export RUBY_HEAP_FREE_MIN=100000
@@ -21,6 +21,17 @@ function switch_to() {
asdf shell $tool $version
}
+function scrub() {
+ rm -fr $HOME/.asdf/installs/**/**/share
+ rm -fr $HOME/.asdf/installs/java/**/man
+ rm -fr $HOME/.asdf/installs/python/**/lib/**/test
+ rm -fr /usr/share/doc/
+ rm -fr /usr/share/dotnet/sdk/NuGetFallbackFolder
+ rm -fr /var/cache/apt/archives/
+ rm -fr /var/lib/apt/lists/*
+ echo "scrub completed"
+}
+
while IFS= read -r line; do
tool=$(echo "$line" | cut -f1)
default_version=$(echo "$line" | cut -f2)
diff --git a/config/02nocache b/config/02nocache
index fe8336f..6add3a9 100644
--- a/config/02nocache
+++ b/config/02nocache
@@ -1,2 +1,2 @@
-Dir::Cache "/root/.deb/cache";
-Dir::Cache::archives "/root/.deb/archives";
+Dir::Cache "";
+Dir::Cache::archives "";