# ESA (C) 2000-2021 # # This file is part of ESA's XMM-Newton Scientific Analysis System (SAS). # # SAS is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # SAS is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with SAS. If not, see . # # # SAS 19.1 Dockerfile # # May 2021 # # Will build the SAS image sas:v19.1 on the image built for Heasoft 6.28 FROM docker4sas:heasoft_6_28 ENV SAS_DIR="/usr/local/SAS/xmmsas_20210317_1624" ENV HEADAS="/usr/local/heasoft-6.28/x86_64-pc-linux-gnu-libc2.31" # Packages required by SAS # # - X libs : libxext, libsm, libxt # - grace : Ext. plotting tool available from Ubuntu repos # - ghostscript : Tools to handle postscript and pdf files.Includes ps2pdf. # - sudo : Allow xmmsas user to become admin and perform any required install # RUN apt update && apt install -y libxext-dev \ libsm-dev \ libxt-dev \ libxss-dev \ libxml2-dev \ xterm \ grace \ ghostscript \ sudo # SAS installation directory RUN mkdir /usr/local/SAS # Copy and untar the SAS tgz archive to /usr/local/SAS ADD sas_19.1.0-Ubuntu18.04.tgz /usr/local/SAS/ # SAS_PERL ENV SAS_PERL="/usr/bin/perl" # Install SAS with the install.sh script RUN cd /usr/local/SAS && /bin/bash -c ./install.sh # Install all required Python packages RUN cd /usr/local/SAS && pip install -r ./sas_19.1.0_python_packages.txt # INSTALL SPECIFIC ASTROQUERY-0.4.3.dev0 VERSION FIX ADD astroquery-0.4.3.dev0.tar.gz /tmp/ RUN cd /tmp/astroquery && python3 setup.py install # Install ds9 + xpa latest versions copied from SAO web site RUN mkdir -p /usr/local/ds9_8.2.1/bin && ln -s /usr/local/ds9_8.2.1 /usr/local/ds9 ADD ds9.ubuntu20.8.2.1.tar.gz /usr/local/ds9/bin/ ADD xpa.ubuntu20.2.1.20.tar.gz /usr/local/ds9/bin/ # Install wcstools-3.9.6 built statically on Ubuntu20.04LTS RUN mkdir /usr/local/wcstools-3.9.6 && ln -s /usr/local/wcstools-3.9.6 /usr/local/wcstools ADD wcstools-3.9.6-bin.tgz /usr/local/wcstools # Heasoft and SAS initialisation can not be done through sourcing a shell script. # The only way is by setting environment variables throughout ENV. # Thus heasoft initialization via ENV is done when building its image and # SAS initialisation is done here. ENV PGPLOT_FONT=${SAS_DIR}/libextra/grfont.dat \ PERL5LIB="${SAS_DIR}/lib/perl5:${PERL5LIB}" \ PYTHONPATH="${SAS_DIR}/lib/python:${PYTHONPATH}" \ SAS_IMAGEVIEWER=ds9 \ SAS_BROWSER=firefox \ LIBRARY_PATH="${SAS_DIR}/libextra:${SAS_DIR}/lib:${LIBRARY_PATH}" \ LD_LIBRARY_PATH="${SAS_DIR}/libextra:${SAS_DIR}/lib:${LD_LIBRARY_PATH}" \ SAS_PATH=${SAS_DIR} \ PATH="${SAS_DIR}/binextra:${SAS_DIR}/bin:${SAS_DIR}/bin/devel:$PATH" \ SAS_SUPPRESS_WARNING=1 # Add ds9, xpa and wcstools to PATH ENV PATH="/usr/local/ds9/bin:/usr/local/wcstools/bin:$PATH" # Create the /ccf directory for CCFs RUN mkdir /ccf && \ groupadd --gid 7000 xmmsas && \ useradd --uid 7000 --gid 7000 --shell /bin/bash --home /home/xmmsas -m xmmsas && \ usermod -p "" xmmsas && \ usermod -aG sudo xmmsas # Provide password xmmsas for Jupyterr Notebook connections RUN mkdir /home/xmmsas/.jupyter COPY jupyter_notebook_config.json /home/xmmsas/.jupyter RUN chown -R xmmsas:xmmsas /home/xmmsas/.jupyter USER xmmsas:xmmsas WORKDIR /home/xmmsas/mywork # PFILES defintion for Heasoft must be delayed until we have a home directory RUN mkdir /home/xmmsas/pfiles ENV PFILES="/home/xmmsas/pfiles;${HEADAS}/syspfiles" # Define the volume for CCFs VOLUME /ccf ENV SAS_CCFPATH=/ccf/valid