From a8d338605ca5e9751b7caab88e11a4b7dafb34ff Mon Sep 17 00:00:00 2001
From: Ruud Beukema <beukema@astron.nl>
Date: Thu, 2 Nov 2017 08:33:48 +0000
Subject: [PATCH] Task #11476: cleaned up Dockerfile

---
 Docker/lofar-documentation/Dockerfile | 77 ++++++++++++++-------------
 1 file changed, 41 insertions(+), 36 deletions(-)

diff --git a/Docker/lofar-documentation/Dockerfile b/Docker/lofar-documentation/Dockerfile
index 04f65959877..89db61505b0 100644
--- a/Docker/lofar-documentation/Dockerfile
+++ b/Docker/lofar-documentation/Dockerfile
@@ -3,32 +3,23 @@ MAINTAINER "Ruud Beukema" <beukema@astron.nl>
 
 # -------------------------------------------------------------------------------------
 # Install set of core repositories and tools
-# maybe add: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL xxxxx?
 
 RUN yum -y update && \
-    yum -y install \
+    yum -y --nogpgcheck install \
       epel-release \
       wget && \
     yum clean all
 
 # -------------------------------------------------------------------------------------
-# Download source code of 3rd party software projects to /opt/downloads first, so that
-# that doesn't need to be repeated when we're iteratively improving the docker
+# Create a download folder
+RUN mkdir -p /opt/downloads
 
-RUN mkdir -p /opt/downloads && \
-    cd /opt/downloads && \
-    \
-    wget -O unittest-cpp-1.6.1.tar.gz https://github.com/unittest-cpp/unittest-cpp/archive/v1.6.1.tar.gz && \
-    wget -O blitz-0.10.tar.gz http://downloads.sourceforge.net/project/blitz/blitz/Blitz%2B%2B%200.10/blitz-0.10.tar.gz && \
-    wget -O casacore-2.1.0.tar.gz https://github.com/casacore/casacore/archive/v2.1.0.tar.gz && \
-    wget -O casarest-1.4.2.tar.gz https://github.com/casacore/casarest/archive/v1.4.2.tar.gz && \
-    wget -O aoflagger-2.9.0.tar.bz2 https://sourceforge.net/projects/aoflagger/files/aoflagger-2.9.0/aoflagger-2.9.0.tar.bz2/download && \
-    wget -O PyBDSF-1.8.9.tar.gz https://github.com/lofar-astron/PyBDSF/archive/v1.8.9.tar.gz && \
-    wget -O DAL-master.tar.gz https://github.com/nextgen-astrodata/DAL/archive/master.tar.gz && \
-    wget -O WSRT_Measures.ztar --ftp-user=anonymous ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar && \
-    wget -O cuda.rpm https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64-rpm && \
-    wget -O plantuml.jar https://sourceforge.net/projects/plantuml/files/plantuml.jar/download && \
-    wget -O doxygen-1.8.11.tar.gz https://sourceforge.net/projects/doxygen/files/rel-1.8.11/doxygen-1.8.11.src.tar.gz/download
+# -------------------------------------------------------------------------------------
+# Install Cuda package
+RUN wget -O /opt/downloads/cuda.rpm https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64-rpm && \
+    rpm -i /opt/downloads/cuda.rpm && \
+    yum install --nogpgcheck -y cuda && \
+    rm /opt/downloads/cuda.rpm
 
 # -------------------------------------------------------------------------------------
 # Copy in the WinCC_OA packages
@@ -45,7 +36,7 @@ RUN rpm --import https://dev.monetdb.org/downloads/MonetDB-GPG-KEY && \
     yum install -y --nogpgcheck /opt/downloads/WinCC_OA_3.14-help-en-rhel-0-4.x86_64.rpm && \
     yum install -y --nogpgcheck /opt/downloads/WinCC_OA_3.14-specialfunctions-rhel-0-4.x86_64.rpm && \
     \
-    yum install -y \
+    yum install -y --nogpgcheck \
     atop \
     autoconf \
     autogen \
@@ -161,20 +152,27 @@ RUN pip install --upgrade pip && \
 # -------------------------------------------------------------------------------------
 # Download, Extract, build and install the downloaded 3rd party dependencies
 
-RUN tar -xzvf /opt/downloads/unittest-cpp-1.6.1.tar.gz -C /opt && \
+RUN wget -O /opt/downloads/unittest-cpp-1.6.1.tar.gz https://github.com/unittest-cpp/unittest-cpp/archive/v1.6.1.tar.gz && \
+    tar -xzvf /opt/downloads/unittest-cpp-1.6.1.tar.gz -C /opt && \
     cd /opt/unittest-cpp-1.6.1 && \
     cmake . && \
     make -j4 && \
     make install && \
-    \
+    rm /opt/downloads/unittest-cpp-1.6.1.tar.gz
+    
+RUN wget -O /opt/downloads/blitz-0.10.tar.gz http://downloads.sourceforge.net/project/blitz/blitz/Blitz%2B%2B%200.10/blitz-0.10.tar.gz && \
     tar xzvf /opt/downloads/blitz-0.10.tar.gz -C /opt && \
     cd /opt/blitz-0.10 && \
     ./configure && \
     make lib install && \
-    \
+    rm /opt/downloads/blitz-0.10.tar.gz
+
+RUN wget -O /opt/downloads/WSRT_Measures.ztar --ftp-user=anonymous ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar && \
     mkdir -p /usr/share/casacore/data && \
     tar -xzf /opt/downloads/WSRT_Measures.ztar -C /usr/share/casacore/data && \
-    \
+    rm /opt/downloads/WSRT_Measures.ztar
+
+RUN wget -O /opt/downloads/casacore-2.1.0.tar.gz https://github.com/casacore/casacore/archive/v2.1.0.tar.gz && \
     mkdir -p /opt/casacore-2.1.0/build && \
     tar -xzf /opt/downloads/casacore-2.1.0.tar.gz -C /opt/casacore-2.1.0 && \
     cd /opt/casacore-2.1.0/build && \
@@ -191,7 +189,9 @@ RUN tar -xzvf /opt/downloads/unittest-cpp-1.6.1.tar.gz -C /opt && \
     make -j4 && \
     make install && \
     ln -s /opt/casacore-2.1.0 /opt/casacore && \
-    \
+    rm /opt/downloads/casacore-2.1.0.tar.gz
+
+RUN wget -O /opt/downloads/casarest-1.4.2.tar.gz https://github.com/casacore/casarest/archive/v1.4.2.tar.gz && \
     mkdir -p /opt/casarest-1.4.2/build && \
     tar -xzf /opt/downloads/casarest-1.4.2.tar.gz -C /opt/casarest-1.4.2 && \    
     cd /opt/casarest-1.4.2/build && \
@@ -208,7 +208,9 @@ RUN tar -xzvf /opt/downloads/unittest-cpp-1.6.1.tar.gz -C /opt && \
     make -j4  && \
     make install && \
     ln -s /opt/casarest-1.4.2 /opt/casarest && \
-    \
+    rm /opt/downloads/casarest-1.4.2.tar.gz
+
+RUN wget -O /opt/downloads/aoflagger-2.9.0.tar.bz2 https://sourceforge.net/projects/aoflagger/files/aoflagger-2.9.0/aoflagger-2.9.0.tar.bz2/download && \
     mkdir -p /opt/aoflagger-2.9.0/build && \
     tar -xjf /opt/downloads/aoflagger-2.9.0.tar.bz2 -C /opt/aoflagger-2.9.0 && \    
     cd /opt/aoflagger-2.9.0/build && \
@@ -219,34 +221,37 @@ RUN tar -xzvf /opt/downloads/unittest-cpp-1.6.1.tar.gz -C /opt && \
        ../aoflagger-2.9.0 && \
     make -j4  && \
     make install  && \
-    \
+    rm /opt/downloads/aoflagger-2.9.0.tar.bz2
+
+RUN wget -O /opt/downloads/PyBDSF-1.8.9.tar.gz https://github.com/lofar-astron/PyBDSF/archive/v1.8.9.tar.gz && \
     mkdir -p /opt/pybdsf-1.8.9/PyBDSF-1.8.9/lib64/python2.7/site-packages && \
     tar -xzf /opt/downloads/PyBDSF-1.8.9.tar.gz -C /opt/pybdsf-1.8.9 && \    
     export PYTHONPATH=/opt/pybdsf-1.8.9/PyBDSF-1.8.9/lib64/python2.7/site-packages:$PYTHONPATH && \
     cd /opt/pybdsf-1.8.9/PyBDSF-1.8.9  && \
     python setup.py install --prefix=/opt/pybdsf-1.8.9/PyBDSF-1.8.9 && \
-    \
+    rm /opt/downloads/PyBDSF-1.8.9.tar.gz
+
+RUN wget -O /opt/downloads/DAL-master.tar.gz https://github.com/nextgen-astrodata/DAL/archive/master.tar.gz && \
     mkdir -p /opt/dal/DAL-master/build && \
     tar -xzf /opt/downloads/DAL-master.tar.gz -C /opt/dal && \    
     cd /opt/dal/DAL-master/build && \
     cmake ../ -DCMAKE_INSTALL_PREFIX=`pwd` && \
     make -j4 && \
     make install && \
-    \
-    rpm -i /opt/downloads/cuda.rpm && \
-    yum install -y cuda && \
-    \
+    rm /opt/downloads/DAL-master.tar.gz
+
+RUN wget -O /opt/downloads/plantuml.jar https://sourceforge.net/projects/plantuml/files/plantuml.jar/download && \
     mkdir /opt/plantuml && \
-    mv /opt/downloads/plantuml.jar /opt/plantuml && \
-    \
+    mv /opt/downloads/plantuml.jar /opt/plantuml
+
+RUN wget -O /opt/downloads/doxygen-1.8.11.tar.gz https://sourceforge.net/projects/doxygen/files/rel-1.8.11/doxygen-1.8.11.src.tar.gz/download && \
     tar -xzf /opt/downloads/doxygen-1.8.11.tar.gz -C /opt/downloads && \
     mkdir -p /opt/downloads/doxygen-1.8.11/build  && \
     cd /opt/downloads/doxygen-1.8.11/build  && \
     cmake -G "Unix Makefiles" .. && \
     make -j4 && \
     make install && \
-    \
-    rm -rf /opt/downloads
+    rm /opt/downloads/doxygen-1.8.11.tar.gz
 
 # Paths that need to be permanently added to some environment variable should be set using the 
 # Docker ENV command
@@ -262,4 +267,4 @@ COPY build_documentation.sh /usr/bin
 # -------------------------------------------------------------------------------------
 # Generate documentation
 ENTRYPOINT ["build_documentation.sh"]
-#CMD ["/bin/bash"]
+# CMD ["/bin/bash"]
-- 
GitLab