diff --git a/Docker/lofar-base/Dockerfile.tmpl b/Docker/lofar-base/Dockerfile.tmpl
index 77228e242bc737535557a3fbcdc5d4c78a52a1f6..a5679fe25f5246792c469484451e37f3ad1310d3 100644
--- a/Docker/lofar-base/Dockerfile.tmpl
+++ b/Docker/lofar-base/Dockerfile.tmpl
@@ -6,7 +6,6 @@ FROM ubuntu:16.04
 #
 # common-environment
 #
-ENV USER=lofar
 ENV INSTALLDIR=/opt
 
 #
@@ -23,11 +22,6 @@ ENV CASACORE_VERSION=latest \
     PYTHON_CASACORE_VERSION=2.1.2 \
     BOOST_VERSION=1.58
 
-#
-# set-uid
-#
-ENV UID=${BUILD_UID}
-
 #
 # set-build-options
 #
@@ -43,8 +37,8 @@ RUN apt-get update && \
     apt-get install -y python-pip && \
     pip install numpy && \
     apt-get purge -y python-pip && \
-    apt-get autoremove -y && \
-    apt-get install -y nano
+    apt-get autoremove -y --purge && \
+    apt-get install -y nano sudo
 
 #
 # open security holes (allow smooth user switching, allow sudo)
@@ -76,7 +70,7 @@ RUN apt-get update && apt-get install -y wget git cmake g++ gfortran flex bison
     bash -c "strip ${INSTALLDIR}/casacore/{lib,bin}/* || true" && \
     bash -c "rm -rf ${INSTALLDIR}/casacore/{build,src}" && \
     apt-get purge -y wget git cmake g++ gfortran flex bison libopenblas-dev libfftw3-dev libhdf5-dev libboost-python-dev libcfitsio-dev wcslib-dev && \
-    apt-get autoremove -y
+    apt-get autoremove -y --purge
 
 #
 # *******************
@@ -93,7 +87,7 @@ RUN apt-get update && apt-get install -y git cmake g++ gfortran libboost-system-
     bash -c "strip ${INSTALLDIR}/casarest/{lib,bin}/* || true" && \
     bash -c "rm -rf ${INSTALLDIR}/casarest/{build,src}" && \
     apt-get purge -y git cmake g++ gfortran libboost-system-dev libboost-thread-dev libhdf5-dev libcfitsio3-dev wcslib-dev libopenblas-dev && \
-    apt-get autoremove -y
+    apt-get autoremove -y --purge
 
 #
 # *******************
@@ -111,7 +105,7 @@ RUN apt-get update && apt-get install -y git make g++ python-setuptools libboost
     bash -c "find ${INSTALLDIR}/python-casacore/lib -name '*.so' | xargs strip || true" && \
     bash -c "rm -rf ${INSTALLDIR}/python-casacore/python-casacore" && \
     apt-get purge -y git make g++ python-setuptools libboost-python-dev libcfitsio3-dev wcslib-dev && \
-    apt-get autoremove -y
+    apt-get autoremove -y --purge
 
 #
 # *******************
@@ -132,7 +126,7 @@ RUN apt-get update && apt-get install -y subversion swig ruby ruby-dev python-de
     bash -c "strip /opt/qpid/{bin,lib}/* || true" && \
     bash -c "rm -rf ~/sources" && \
     apt-get purge -y subversion swig ruby ruby-dev python-dev libsasl2-dev pkg-config cmake libtool uuid-dev libxerces-c-dev libnss3-dev libnspr4-dev help2man fakeroot build-essential debhelper libsslcommon2-dev libxqilla-dev python-setuptools libboost-program-options${BOOST_VERSION}-dev libboost-filesystem${BOOST_VERSION}-dev && \
-    apt-get autoremove -y
+    apt-get autoremove -y --purge
 #
 # *******************
 #   DAL
@@ -147,7 +141,7 @@ RUN apt-get update && apt-get install -y git cmake g++ swig python-dev libhdf5-d
     bash -c "find ${INSTALLDIR}/DAL/lib -name '*.so' | xargs strip || true" && \
     bash -c "rm -rf ${INSTALLDIR}/DAL/{src,build}" && \
     apt-get purge -y git cmake g++ swig python-dev libhdf5-dev && \
-    apt-get autoremove -y
+    apt-get autoremove -y --purge
 
 #
 # entry
diff --git a/Docker/lofar-outputproc/Dockerfile.tmpl b/Docker/lofar-outputproc/Dockerfile.tmpl
index c25fffe979accf5de9a8fd12bae4b73fa3702872..818e940c86158454f0585711c5af4a457b16f3c0 100644
--- a/Docker/lofar-outputproc/Dockerfile.tmpl
+++ b/Docker/lofar-outputproc/Dockerfile.tmpl
@@ -10,7 +10,7 @@ FROM lofar-base:${LOFAR_TAG}
 #
 
 # Run-time dependencies
-RUN apt-get update && apt-get install -y liblog4cplus-1.1-9 libxml2 libboost-thread${BOOST_VERSION}.0 libboost-filesystem${BOOST_VERSION}.0 libboost-date-time${BOOST_VERSION}.0 libpng12-0 libsigc++-2.0-dev libxml++2.6-2v5 libboost-regex${BOOST_VERSION}.0
+RUN apt-get update && apt-get install -y binutils liblog4cplus-1.1-9 libxml2 libboost-thread${BOOST_VERSION}.0 libboost-filesystem${BOOST_VERSION}.0 libboost-date-time${BOOST_VERSION}.0 libpng12-0 libsigc++-2.0-dev libxml++2.6-2v5 libboost-regex${BOOST_VERSION}.0
 
 # Tell image build information
 ENV LOFAR_BRANCH=${LOFAR_BRANCH} \
@@ -18,7 +18,7 @@ ENV LOFAR_BRANCH=${LOFAR_BRANCH} \
     LOFAR_BUILDVARIANT=gnucxx11_optarch
 
 # Install
-RUN apt-get update && apt-get install -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev libboost-regex${BOOST_VERSION} binutils-dev libopenblas-dev && libcfitsio3-dev wcslib-dev \
+RUN apt-get update && apt-get install -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev libboost-regex${BOOST_VERSION} binutils-dev libopenblas-dev libcfitsio3-dev wcslib-dev && \
     mkdir -p ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && \
     cd ${INSTALLDIR}/lofar && \
     svn --non-interactive -q co -r ${LOFAR_REVISION} -N ${LOFAR_BRANCH_URL} src; \
@@ -31,7 +31,7 @@ RUN apt-get update && apt-get install -y subversion cmake g++ gfortran bison fle
     bash -c "ln -sfT /home/${USER}/lofar/var ${INSTALLDIR}/lofar/var" && \
     bash -c "strip ${INSTALLDIR}/lofar/{bin,sbin,lib64}/* || true" && \
     bash -c "rm -rf ${INSTALLDIR}/lofar/{build,src}" && \
-    setcap cap_sys_nice,cap_ipc_lock=ep ${INSTALLDIR}/lofar/bin/outputProc && \
-    apt-get purge -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev binutils-dev libcfitsio3-dev wcslib-dev libopenblas-dev && libcfitsio3-dev wcslib-dev \
-    apt-get autoremove -y
+    setcap cap_sys_nice,cap_sys_admin=ep ${INSTALLDIR}/lofar/bin/outputProc && \
+    apt-get purge -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev binutils-dev libcfitsio3-dev wcslib-dev libopenblas-dev && \
+    apt-get autoremove -y --purge
 
diff --git a/Docker/lofar-pipeline/Dockerfile.tmpl b/Docker/lofar-pipeline/Dockerfile.tmpl
index 94c6299eeffd5486c8b585e93793f7b72efc99fa..cd2c9a16f53de6e2872834b81e5595624d670399 100644
--- a/Docker/lofar-pipeline/Dockerfile.tmpl
+++ b/Docker/lofar-pipeline/Dockerfile.tmpl
@@ -6,11 +6,11 @@ FROM lofar-base:${LOFAR_TAG}
 ENV AOFLAGGER_VERSION=2.8.0
 
 # Run-time dependencies
-RUN apt-get update && apt-get install -y python-xmlrunner python-scipy liblog4cplus-1.1-9 libxml2 libboost-thread${BOOST_VERSION}.0 libboost-filesystem${BOOST_VERSION}.0 libboost-date-time${BOOST_VERSION}.0 libboost-signals${BOOST_VERSION}.0 libpng12-0 libsigc++-2.0-dev libxml++2.6-2v5 libgsl2 openssh-client libboost-regex${BOOST_VERSION}.0 gettext-base rsync python-matplotlib && \
+RUN apt-get update && apt-get install -y python-xmlrunner python-scipy liblog4cplus-1.1-9 libxml2 libboost-thread${BOOST_VERSION}.0 libboost-filesystem${BOOST_VERSION}.0 libboost-date-time${BOOST_VERSION}.0 libboost-signals${BOOST_VERSION}.0 libpng12-0 libsigc++-2.0-dev libxml++2.6-2v5 libgsl2 openssh-client libboost-regex${BOOST_VERSION}.0 gettext-base rsync python-matplotlib ipython slurm-client && \
     apt-get -y install python-pip python-dev && \
     pip install pyfits pywcs python-monetdb && \
     apt-get -y purge python-pip python-dev && \
-    apt-get -y autoremove
+    apt-get -y autoremove --purge
 
 #
 # *******************
@@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y wget cmake g++ libxml++2.6-dev libpng12
     bash -c "rm -rf ${INSTALLDIR}/aoflagger/{build,aoflagger-${AOFLAGGER_VERSION}}" && \
     bash -c "rm -rf ${INSTALLDIR}/aoflagger/aoflagger-${AOFLAGGER_VERSION}.tar.bz2" && \
     apt-get -y purge wget cmake g++ libxml++2.6-dev libpng12-dev libfftw3-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-signals${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev libcfitsio3-dev libopenblas-dev && \
-    apt-get -y autoremove
+    apt-get -y autoremove --purge
 
 #
 # *******************
@@ -58,5 +58,4 @@ RUN apt-get update && apt-get install -y subversion cmake g++ gfortran bison fle
     bash -c "strip ${INSTALLDIR}/lofar/{bin,sbin,lib64}/* || true" && \
     bash -c "rm -rf ${INSTALLDIR}/lofar/{build,src}" && \
     apt-get purge -y subversion cmake g++ gfortran bison flex liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python-dev python-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libgsl-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev binutils-dev libcfitsio3-dev wcslib-dev libopenblas-dev && \
-    apt-get autoremove -y
-
+    apt-get autoremove -y --purge