From ce77ad60e7a9d77f94a89447e66365ed55b440c2 Mon Sep 17 00:00:00 2001
From: David Hoese <david.hoese@ssec.wisc.edu>
Date: Wed, 16 Sep 2020 09:11:22 -0500
Subject: [PATCH] Reduce the size of the docker image by removing build caches

---
 mapserver/Dockerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mapserver/Dockerfile b/mapserver/Dockerfile
index bdcaac2..994a50f 100644
--- a/mapserver/Dockerfile
+++ b/mapserver/Dockerfile
@@ -24,6 +24,7 @@ RUN mkdir -p /build_deps && cd /build_deps \
   && cmake .. -DWITH_PROTOBUFC=OFF -DWITH_POSTGIS=OFF \
   && make -j$(nproc) \
   && make install
+  && cd && rm -rf /build_deps
 
 # apache
 # http://www.inanzzz.com/index.php/post/rhsb/running-apache-server-as-foreground-on-ubuntu-with-dockerfile
@@ -87,7 +88,7 @@ RUN ln -s /usr/local/bin/mapserv /usr/lib/cgi-bin/mapserv && \
     chown ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/* && \
     chown -h ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /usr/lib/cgi-bin/*
 
-RUN pip3 install jinja2
+RUN pip3 install jinja2 && rm -r /root/.cache/pip
 COPY render.py run.sh abi_l1b_template.map /work/
 COPY mapfiles/ /work/mapfiles/
 COPY html/ /var/www/html/
-- 
GitLab