From d39b57509c1fbdd2b7a2cd62d5d31a719fdd1ece Mon Sep 17 00:00:00 2001
From: mancini <mancini@astron.nl>
Date: Tue, 25 May 2021 15:29:49 +0200
Subject: [PATCH] Update docker file

---
 Docker/.dockerignore        |   7 +
 Docker/Dockerfile           | 130 +++++++++++++----
 Docker/Dockerfile.orig      | 277 ++++++++++++++++++++++++++++++++++++
 Docker/build_docker.sh      |  40 +++++-
 Docker/build_docker.sh.orig |  94 ++++++++++++
 5 files changed, 513 insertions(+), 35 deletions(-)
 create mode 100644 Docker/.dockerignore
 create mode 100644 Docker/Dockerfile.orig
 create mode 100755 Docker/build_docker.sh.orig

diff --git a/Docker/.dockerignore b/Docker/.dockerignore
new file mode 100644
index 0000000..5043d3f
--- /dev/null
+++ b/Docker/.dockerignore
@@ -0,0 +1,7 @@
+#Aoflagger/.git
+casacore/.git
+#DP3/.git
+Dysco/.git
+#idg/.git
+LOFARBeam/.git
+STMAN/.git
diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index 7eb1e96..88bb08d 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -1,17 +1,24 @@
-FROM kernsuite/base:5 as builder
+FROM kernsuite/base:6 as builder
 SHELL ["/bin/bash", "-c"]
 
 RUN export DEBIAN_FRONTEND=noninteractive && \ 
     apt-get update && \
     apt-get install -y \
+        gfortran \ 
+        flex \
+        bison \
+        wcslib-dev \        
+        libncurses5-dev \
         casacore-data \
         casacore-dev \
         libboost-python-dev \
         libcfitsio-dev \
         python-dev \
         python3-numpy \
+        libcasa* \
         cmake \
         build-essential \
+        liblua5.3-dev \
         libhdf5-serial-dev \
         libarmadillo-dev \
         libboost-filesystem-dev \
@@ -21,10 +28,10 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         libboost-signals-dev \ 
         libboost-program-options-dev \
         libboost-test-dev \
+        pybind11-dev   \
         libxml2-dev \
         libpng-dev \
         pkg-config \
-        aoflagger-dev \
         libgtkmm-3.0-dev \
         git \
         wget \
@@ -35,20 +42,21 @@ RUN mkdir -p /src/
 WORKDIR /src/
 
 
-# Build the IDG version from source
-
-
-ADD ./idg /src/idg/src
-RUN mkdir idg/build && cd idg/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ../src && make install -j2
-
-ADD ./DP3 /src/dp3/src
-RUN cd /src/dp3/  && \
-    mkdir build && \
-    cd build && \
-    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
-    make -j2 && \
-    make install -j2
+#ADD ./casacore /src/casacore/src
+#RUN cd /src/casacore/ && \
+#    mkdir build && \
+#    cd build && \
+#    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ \
+#    -DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
+#    -DDATA_DIR=/usr/share/casacore/data/ \ 
+#    -DUSE_OPENMP=ON \
+#    -DUSE_HDF5=ON \
+#    -DBUILD_PYTHON3=ON -DBUILD_PYTHON=OFF\
+#    -DUSE_THREADS=ON && \
+#    make -j5 && \
+#    make install -j5
 
+    
 ADD ./STMAN /src/STMAN/src
 RUN cd /src/STMAN/ && \
     mkdir build && \
@@ -57,6 +65,7 @@ RUN cd /src/STMAN/ && \
     make -j2 && \
     make install -j2
     
+
 ADD ./Dysco /src/Dysco/src
 RUN cd /src/Dysco/ && \
     mkdir build && \
@@ -64,17 +73,59 @@ RUN cd /src/Dysco/ && \
     cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True && \
     make -j2 && \
     make install -j2
+    
+    
+ADD ./idg /src/idg/src
+RUN mkdir idg/build && cd idg/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ../src && make install -j2
+
+
+ADD ./Aoflagger /src/Aoflagger/src
+RUN cd /src/Aoflagger/ && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPYTHON_EXECUTABLE=/usr/bin/python3.6 && \
+    make -j2 && \
+    make install -j2
+
 
 ADD ./LOFARBeam /src/LOFARBeam/src
 RUN cd /src/LOFARBeam/ && \
     mkdir build && \
     cd build && \
-    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPYTHON_EXECUTABLE=/usr/bin/python3 && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPYTHON_EXECUTABLE=/usr/bin/python3.6 && \
     make -j2 && \
     make install -j2
 
+ADD ./Everybeam /src/Everybeam/src
+RUN cd /src/Everybeam/ && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/&& \
+    make -j2 && \
+    make install -j2
+
+    
+    
+ADD ./DP3 /src/dp3/src
+RUN cd /src/dp3/  && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ \
+    -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DPORTABLE=True \
+    -DAOFlagger_DIR=/usr/local/ &&\
+    make -j2 && \
+    make install -j2
+
+    
+COPY ./wsclean/wsclean /src/WSClean/src
+RUN cd /src/WSClean/ && \
+    mkdir build && cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j2 && make install -j2
+
+
 #----------------------------------------------
-FROM kernsuite/base:5 as runner
+FROM kernsuite/base:6 as runner
 
 COPY --from=builder /usr/local/ /usr/local
 
@@ -83,9 +134,12 @@ SHELL ["/bin/bash", "-c"]
 RUN export DEBIAN_FRONTEND=noninteractive && \
     apt-get update && \
     apt-get install -y \
-        aoflagger \
         casacore-data \
+        wcslib-dev \        
         libarmadillo8 \
+        bison \
+        libncurses5 \ 
+        flex \
         libboost-date-time1.65.1 \
         libboost-filesystem1.65.1 \
         libboost-numpy1.65.1 \
@@ -95,9 +149,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         libboost-signals1.65.1 \
         libboost-test1.65.1 \
         libboost-python1.65-dev \
-        libstationresponse2 \
+        libstationresponse3 \
+        liblua5.3-dev \
         libcasa-* \
+        pybind11-dev   \
         libcfitsio5 \
+        libcfitsio-dev \
         libgtkmm-3.0 \
         libfftw3-3 \
         libhdf5-cpp-100 \
@@ -105,6 +162,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
         libxml2 \
         python3.7 \
         python3-casacore \
+	dysco \
         python3-numpy \
         python3-scipy && \
     rm -rf /var/lib/apt/lists/*
@@ -115,6 +173,10 @@ RUN mkdir /home/lofaruser/ && \
     useradd --no-log-init -r -g lofaruser lofaruser && \
     chown lofaruser:lofaruser /home/lofaruser
 
+
+ARG CASACORE_TAG=master
+LABEL casacore.version.tag=${CASACORE_TAG}
+    
 ARG TOIL_VERSION=3.20.0
 LABEL toil.version=${TOIL_VERSION}
 
@@ -132,16 +194,33 @@ LABEL Dysco.version.tag=${Dysco_TAG}
 
 ARG LofarBeam_TAG=master
 LABEL LOFARBeam.version.tag=${LofarBeam_TAG}
+
+ARG DP3_TAG=master
+LABEL DP3.version.tag=${DP3_TAG}
+
+ARG IDG_TAG=master
+LABEL IDG.version.tag=${IDG_TAG}
+
+ARG Everybeam_TAG
+LABEL Everybeam.version.tag=${Everybeam_TAG}
+
+ARG Aoflagger_TAG
+LABEL Aoflagger.version.tag=${Aoflagger_TAG}
+
+ARG RMextract_TAG
+LABEL RMextract.version.tag=${RMExtract_TAG}
+
+ARG wsclean_TAG
+LABEL wsclean.version.tag=${wsclean_TAG}
     
-RUN apt-get --allow-releaseinfo-change update -y  && apt install -y nodejs python3-pip git wsclean
+RUN apt-get --allow-releaseinfo-change update -y  && apt install -y nodejs python3-pip git
 RUN python3 -m pip install cwltool cwl-runner -e "git://github.com/darafferty/LSMTool.git@${LSMTool_TAG}#egg=LSMTool" \
                                    "toil[cwl]"==${TOIL_VERSION} \
                                    matplotlib
 
-RUN python3 -m pip install -e "git+https://github.com/revoltek/losoto.git@${LoSoTo_TAG}#egg=LoSoTo"
+RUN python3 -m pip install -e "git+https://github.com/revoltek/losoto.git@${LoSoTo_TAG}#egg=LoSoTo" ipython \
+                              "git+https://github.com/lofar-astron/RMextract.git@${RMextract_TAG}#egg=RMextract"
 
-ADD losoto.patch /home/lofaruser/losoto.patch
-RUN patch /src/losoto/losoto/operations/__init__.py /home/lofaruser/losoto.patch 
 ADD .entrypoint /home/lofaruser/.entrypoint
 RUN chown lofaruser:lofaruser /home/lofaruser/.entrypoint && \ 
     chmod +rx /home/lofaruser/.entrypoint
@@ -153,8 +232,3 @@ RUN chmod +rx /usr/local/bin/*
 ENTRYPOINT ["/home/lofaruser/.entrypoint"]
 USER lofaruser
 ENV PYTHONPATH=/usr/local/lib/python3.6/site-packages/
-ARG DP3_TAG=master
-ARG IDG_TAG=master
-
-LABEL IDG.version.tag=${IDG_TAG}
-LABEL DP3.version.tag=${DP3_TAG}
diff --git a/Docker/Dockerfile.orig b/Docker/Dockerfile.orig
new file mode 100644
index 0000000..54d09b6
--- /dev/null
+++ b/Docker/Dockerfile.orig
@@ -0,0 +1,277 @@
+FROM kernsuite/base:5 as builder
+SHELL ["/bin/bash", "-c"]
+<<<<<<< HEAD
+
+RUN export DEBIAN_FRONTEND=noninteractive && \ 
+    apt-get update && \
+    apt-get install -y \
+=======
+ARG NPROCS=2
+RUN export DEBIAN_FRONTEND=noninteractive && \ 
+    apt-get update && \
+    apt-get install -y  \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        casacore-data \
+        casacore-dev \
+        libboost-python-dev \
+        libcfitsio-dev \
+        python-dev \
+        python3-numpy \
+        cmake \
+        build-essential \
+        libhdf5-serial-dev \
+        libarmadillo-dev \
+<<<<<<< HEAD
+        libboost-filesystem-dev \
+        libboost-system-dev \
+        libboost-date-time-dev \
+        libboost-numpy-dev \
+        libboost-signals-dev \ 
+=======
+        libboost-date-time-dev \
+        libboost-filesystem-dev \
+        libboost-thread-dev \
+        libboost-system-dev \
+        libboost-program-options-dev \
+        libboost-chrono-dev \
+        libboost-atomic-dev \
+        libboost-system-dev \
+        libboost-date-time-dev \
+        libboost-numpy-dev \
+        libboost-signals-dev \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        libboost-program-options-dev \
+        libboost-test-dev \
+        libxml2-dev \
+        libpng-dev \
+<<<<<<< HEAD
+        pkg-config \
+        aoflagger-dev \
+=======
+        lua5.3-dev \
+        pkg-config \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        libgtkmm-3.0-dev \
+        git \
+        wget \
+        libfftw3-dev \
+        libgsl-dev
+        
+RUN mkdir -p /src/
+WORKDIR /src/
+
+
+# Build the IDG version from source
+<<<<<<< HEAD
+
+
+ADD ./idg /src/idg/src
+RUN mkdir idg/build && cd idg/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ../src && make install -j2
+
+ADD ./DP3 /src/dp3/src
+RUN cd /src/dp3/  && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j2 && \
+    make install -j2
+
+ADD ./STMAN /src/STMAN/src
+=======
+COPY ./idg /src/idg/src
+RUN mkdir idg/build && cd idg/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ ../src && make install -j$NPROCS
+
+
+COPY ./STMAN /src/STMAN/src
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+RUN cd /src/STMAN/ && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True && \
+<<<<<<< HEAD
+    make -j2 && \
+    make install -j2
+    
+ADD ./Dysco /src/Dysco/src
+=======
+    make -j$NPROCS && \
+    make install -j$NPROCS
+    
+COPY ./Dysco /src/Dysco/src
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+RUN cd /src/Dysco/ && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True && \
+<<<<<<< HEAD
+    make -j2 && \
+    make install -j2
+
+ADD ./LOFARBeam /src/LOFARBeam/src
+=======
+    make -j$NPROCS && \
+    make install -j$NPROCS
+
+COPY ./LOFARBeam /src/LOFARBeam/src
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+RUN cd /src/LOFARBeam/ && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPYTHON_EXECUTABLE=/usr/bin/python3 && \
+<<<<<<< HEAD
+    make -j2 && \
+    make install -j2
+=======
+    make -j$NPROCS && \
+    make install -j$NPROCS
+    
+COPY ./aoflagger /src/aoflagger/src
+RUN cd /src/aoflagger/  && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j$NPROCS && \
+    make install -j$NPROCS
+    
+COPY ./DP3 /src/dp3/src
+RUN cd /src/dp3/  && \
+    mkdir build && \
+    cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j$NPROCS && \
+    make install -j$NPROCS
+
+COPY ./wsclean/wsclean /src/WSClean/src
+RUN cd /src/WSClean/ && \
+    mkdir build && cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j$NPROCS && make install -j$NPROCS
+
+COPY ./wsclean/chgcentre /src/chgcenter/src
+RUN cd /src/chgcenter/ && \
+    mkdir build && cd build && \
+    cmake ../src -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=True &&\
+    make -j$NPROCS && make install -j$NPROCS
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+
+#----------------------------------------------
+FROM kernsuite/base:5 as runner
+
+COPY --from=builder /usr/local/ /usr/local
+
+SHELL ["/bin/bash", "-c"]
+
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y \
+<<<<<<< HEAD
+        aoflagger \
+        casacore-data \
+        libarmadillo8 \
+=======
+        casacore-data \
+        libarmadillo8 \
+        libboost-filesystem1.65.1 \
+        libboost-thread1.65.1 \
+        libboost-chrono1.65.1 \
+        libboost-atomic1.65.1 \
+        libboost-program-options1.65.1 \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        libboost-date-time1.65.1 \
+        libboost-filesystem1.65.1 \
+        libboost-numpy1.65.1 \
+        libboost-python1.65.1 \
+        libboost-program-options1.65.1 \
+        libboost-system1.65.1 \
+        libboost-signals1.65.1 \
+        libboost-test1.65.1 \
+        libboost-python1.65-dev \
+        libstationresponse2 \
+        libcasa-* \
+        libcfitsio5 \
+        libgtkmm-3.0 \
+<<<<<<< HEAD
+=======
+        libgsl23 \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        libfftw3-3 \
+        libhdf5-cpp-100 \
+        libpng16-16 \
+        libxml2 \
+<<<<<<< HEAD
+=======
+        lua5.3 \
+        liblua5.3 \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+        python3.7 \
+        python3-casacore \
+        python3-numpy \
+        python3-scipy && \
+    rm -rf /var/lib/apt/lists/*
+
+
+RUN mkdir /home/lofaruser/ && \ 
+    groupadd -r lofaruser && \
+    useradd --no-log-init -r -g lofaruser lofaruser && \
+    chown lofaruser:lofaruser /home/lofaruser
+
+ARG TOIL_VERSION=3.20.0
+LABEL toil.version=${TOIL_VERSION}
+
+ARG LSMTool_TAG=master
+LABEL LSMTool.version.tag=${LSMTool_TAG}
+
+ARG LoSoTo_TAG=master
+LABEL LoSoTo.version.tag=${LoSoTo_TAG}
+
+ARG STMAN_TAG=master
+LABEL STMAN.version.tag=${STMAN_TAG}
+
+ARG Dysco_TAG=master
+LABEL Dysco.version.tag=${Dysco_TAG}
+
+ARG LofarBeam_TAG=master
+LABEL LOFARBeam.version.tag=${LofarBeam_TAG}
+<<<<<<< HEAD
+    
+RUN apt-get --allow-releaseinfo-change update -y  && apt install -y nodejs python3-pip git wsclean
+=======
+
+ARG WSClean_TAG=master
+LABEL WSClean.version.tag=${WSClean_TAG}
+
+    
+RUN apt-get --allow-releaseinfo-change update -y  && apt install -y nodejs python3-pip git
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+RUN python3 -m pip install cwltool cwl-runner -e "git://github.com/darafferty/LSMTool.git@${LSMTool_TAG}#egg=LSMTool" \
+                                   "toil[cwl]"==${TOIL_VERSION} \
+                                   matplotlib
+
+RUN python3 -m pip install -e "git+https://github.com/revoltek/losoto.git@${LoSoTo_TAG}#egg=LoSoTo"
+
+<<<<<<< HEAD
+ADD losoto.patch /home/lofaruser/losoto.patch
+RUN patch /src/losoto/losoto/operations/__init__.py /home/lofaruser/losoto.patch 
+=======
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+ADD .entrypoint /home/lofaruser/.entrypoint
+RUN chown lofaruser:lofaruser /home/lofaruser/.entrypoint && \ 
+    chmod +rx /home/lofaruser/.entrypoint
+
+WORKDIR /home/lofaruser
+
+
+RUN chmod +rx /usr/local/bin/*
+ENTRYPOINT ["/home/lofaruser/.entrypoint"]
+USER lofaruser
+ENV PYTHONPATH=/usr/local/lib/python3.6/site-packages/
+ARG DP3_TAG=master
+ARG IDG_TAG=master
+
+LABEL IDG.version.tag=${IDG_TAG}
+LABEL DP3.version.tag=${DP3_TAG}
+<<<<<<< HEAD
+=======
+LABEL AOFLAGGER.version.tag=${AOFLAGGER_TAG}
+
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
diff --git a/Docker/build_docker.sh b/Docker/build_docker.sh
index 83c6dd8..765be33 100755
--- a/Docker/build_docker.sh
+++ b/Docker/build_docker.sh
@@ -7,38 +7,61 @@ git_clone_or_pull () {
     DIR=$3
     if [ -d $DIR ] 
     then
-     git -C "${DIR}" pull
+     cd ${DIR}
+     git fetch --all
+     git checkout ${BRANCH}
+     cd -
     else
-     git clone --depth 1 -b "${BRANCH}" "${REPO}" "${DIR}"
+     git clone -b "${BRANCH}" "${REPO}" "${DIR}"
     fi
 }
 
 # SOFTWARE VERSIONS
-DP3_TAG=v4.1
-IDG_TAG=0.6
+DP3_TAG=v5.1
+Dysco_TAG=v1.2
+Everybeam_TAG=v0.1.2
+Aoflagger_TAG=v3.1.0
+LofarBeam_TAG=master
+IDG_TAG=0.8
 LSMTool_TAG=v1.4.2
-LoSoTo_TAG=f0398b
+LoSoTo_TAG=master
 TOIL_VERSION=3.20.0
 STMAN_TAG=master
-Dysco_TAG=v1.2
 Prefactor_TAG=master
-LofarBeam_TAG=master
+CASACORE_TAG=v3.4.0
+RMextract_TAG=v0.4
+
+wsclean_tag=master
+
+## FETCHES casacore
+#git_clone_or_pull https://github.com/casacore/casacore ${CASACORE_TAG} casacore
 
 # FETCHES THE IDG
 git_clone_or_pull https://gitlab.com/astron-idg/idg/ ${IDG_TAG} idg
 
+# FETCHES Aoflagger
+git_clone_or_pull https://gitlab.com/aroffringa/aoflagger.git ${Aoflagger_TAG} Aoflagger
+
 # FETCHES DP3
 git_clone_or_pull https://github.com/lofar-astron/DP3 ${DP3_TAG} DP3
 
+
 # FETCHES STMAN
 git_clone_or_pull https://github.com/lofar-astron/LofarStMan ${STMAN_TAG} STMAN
 
 # FETCHES Dysco
 git_clone_or_pull https://github.com/aroffringa/dysco.git ${Dysco_TAG} Dysco
 
+# FETCHES Everybeam
+git_clone_or_pull https://git.astron.nl/RD/EveryBeam.git ${Everybeam_TAG} Everybeam
+
 # FETCHES LOFARBeam
 git_clone_or_pull https://github.com/lofar-astron/LOFARBeam ${LofarBeam_TAG} LOFARBeam
 
+# FETCHES WSClean
+git_clone_or_pull https://git.code.sf.net/p/wsclean/code ${wsclean_tag} wsclean
+
+
 SCRIPT_PATH=$(realpath ${BASH_SOURCE[0]})
 
 DOCKER_PATH=$(dirname ${SCRIPT_PATH})
@@ -47,10 +70,13 @@ docker build ${DOCKER_PATH} --build-arg=IDG_TAG=${IDG_TAG}\
                             --build-arg=DP3_TAG=${DP3_TAG}\
                             --build-arg=LSMTool_TAG=${LSMTool_TAG}\
                             --build-arg=LoSoTo_TAG=${LoSoTo_TAG}\
+                            --build-arg=Everybeam_TAG=${Everybeam_TAG}\
                             --build-arg=STMAN_TAG=${STMAN_TAG}\
                             --build-arg=Dysco_TAG=${Dysco_TAG}\
                             --build-arg=TOIL_VERSION=${TOIL_VERSION}\
+                            --build-arg=WSClean_TAG=${wsclean_tag} \
 			    --build-arg=LofarBeam_TAG=${LofarBeam_TAG}\
+			    --build-arg=RMextract_TAG=${RMextract_TAG} \
                             -t lofareosc/lofar-pipeline
 
 docker build ${DOCKER_PATH} -f ${DOCKER_PATH}/Dockerfile_ci -t lofareosc/lofar-pipeline-ci
diff --git a/Docker/build_docker.sh.orig b/Docker/build_docker.sh.orig
new file mode 100755
index 0000000..13a51ee
--- /dev/null
+++ b/Docker/build_docker.sh.orig
@@ -0,0 +1,94 @@
+#! /bin/bash
+set -e
+
+git_clone_or_pull () {
+    REPO=$1
+    BRANCH=$2
+    DIR=$3
+<<<<<<< HEAD
+    if [ -d $DIR ] 
+    then
+     git -C "${DIR}" pull
+=======
+    OLD_DIR=${PWD}
+    if [ -d $DIR ] 
+    then     
+     cd ${DIR}
+     git checkout ${BRANCH}
+     git pull
+     cd ${OLD_DIR}
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+    else
+     git clone --depth 1 -b "${BRANCH}" "${REPO}" "${DIR}"
+    fi
+}
+
+# SOFTWARE VERSIONS
+<<<<<<< HEAD
+DP3_TAG=v4.1
+IDG_TAG=0.6
+LSMTool_TAG=v1.4.2
+LoSoTo_TAG=f0398b
+=======
+AOFLAGGER_TAG=v2.15.0
+DP3_TAG=v4.1
+IDG_TAG=master
+LSMTool_TAG=v1.4.2
+LoSoTo_TAG=master
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+TOIL_VERSION=3.20.0
+STMAN_TAG=master
+Dysco_TAG=v1.2
+Prefactor_TAG=master
+<<<<<<< HEAD
+LofarBeam_TAG=master
+=======
+LofarBeam_TAG=v4.1.1
+wsclean_tag=master
+
+# FETCHES AOFLAGGER
+git_clone_or_pull https://git.code.sf.net/p/aoflagger/code ${AOFLAGGER_TAG} aoflagger
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+
+# FETCHES THE IDG
+git_clone_or_pull https://gitlab.com/astron-idg/idg/ ${IDG_TAG} idg
+
+# FETCHES DP3
+git_clone_or_pull https://github.com/lofar-astron/DP3 ${DP3_TAG} DP3
+
+# FETCHES STMAN
+git_clone_or_pull https://github.com/lofar-astron/LofarStMan ${STMAN_TAG} STMAN
+
+# FETCHES Dysco
+git_clone_or_pull https://github.com/aroffringa/dysco.git ${Dysco_TAG} Dysco
+
+# FETCHES LOFARBeam
+git_clone_or_pull https://github.com/lofar-astron/LOFARBeam ${LofarBeam_TAG} LOFARBeam
+
+<<<<<<< HEAD
+=======
+# FETCHES WSClean
+git_clone_or_pull https://git.code.sf.net/p/wsclean/code ${wsclean_tag} wsclean
+
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+SCRIPT_PATH=$(realpath ${BASH_SOURCE[0]})
+
+DOCKER_PATH=$(dirname ${SCRIPT_PATH})
+
+docker build ${DOCKER_PATH} --build-arg=IDG_TAG=${IDG_TAG}\
+                            --build-arg=DP3_TAG=${DP3_TAG}\
+                            --build-arg=LSMTool_TAG=${LSMTool_TAG}\
+                            --build-arg=LoSoTo_TAG=${LoSoTo_TAG}\
+                            --build-arg=STMAN_TAG=${STMAN_TAG}\
+                            --build-arg=Dysco_TAG=${Dysco_TAG}\
+                            --build-arg=TOIL_VERSION=${TOIL_VERSION}\
+<<<<<<< HEAD
+			    --build-arg=LofarBeam_TAG=${LofarBeam_TAG}\
+=======
+                            --build-arg=LofarBeam_TAG=${LofarBeam_TAG}\
+                            --build-arg=WSClean_TAG=${wsclean_tag} \
+                            --build-arg=NPROCS=10 \
+>>>>>>> 17890d3adb24ee36ca090df27f8139dbf5125f81
+                            -t lofareosc/lofar-pipeline
+
+docker build ${DOCKER_PATH} -f ${DOCKER_PATH}/Dockerfile_ci -t lofareosc/lofar-pipeline-ci
-- 
GitLab