# 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 . # # # # Dockerfile to create the Heasoft minimal image to be used by SAS # # SAS requires basically the FTOOLS from Heasoft, not the rest of it. # Since v6.28, Heasoft offers the option to create a Docker image # from a the tar.gz archive resulting from the selection of Heasoft # components in its web site. # # What we have called the "minimal" Heasoft is the component # "General-Use FTOOLS" (which also includes the Xspec component from # XANADU). Then, unpacking this archive, we have created the Heasoft image. # # Based on Ubuntu 20.04LTS, aka focal. FROM ubuntu:20.04 ARG heasoft_version=6.28 ENV HEADAS="/usr/local/heasoft-${heasoft_version}/x86_64-pc-linux-gnu-libc2.31" # To avoid interactive setting of package installations ARG DEBIAN_FRONTEND=noninteractive # To allow automatic setting of Time Zone ENV TZ=CET RUN ln -s /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/tinezone # To build Heasoft we need these environment variables ENV CC=/usr/bin/gcc \ CXX=/usr/bin/g++ \ FC=/usr/bin/gfortran \ PERL=/usr/bin/perl \ PYTHON=/usr/bin/python # Install software RUN apt update && \ apt install -y \ gcc \ g++ \ gfortran \ libncurses5-dev \ libreadline6-dev \ libreadline-dev \ ncurses-dev \ perl \ python3 \ python3-dev \ python3-pip \ python-is-python3 \ xorg-dev \ build-essential \ make \ wget \ tcsh \ libcurl4 \ libcurl4-gnutls-dev \ vim \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Copy and uncompress heasoft-6.28 to installation directory ADD heasoft-6.28src.tar.gz /usr/local # Build Heasoft RUN cd /usr/local/heasoft-${heasoft_version}/BUILD_DIR && \ ./configure > config.out 2>&1 && \ make > build.log 2>&1 && \ make install > install.log 2>&1 # Heasoft initialisation can not be done via sourcing the headas-init.sh shell # script but using the ENV command to define the necessary environment variables. # For Heasoft this is done here, so the image created inherits these variables. ENV PGPLOT_RGB=${HEADAS}/lib/rgb.txt \ PGPLOT_DIR=${HEADAS}/lib \ PGPLOT_FONT=${HEADAS}/lib/grfont.dat \ LYNX_CFG=${HEADAS}/lib \ PERLIB=${HEADAS}/lib/perl \ PERL5LIB=${HEADAS}/lib/perl \ FTOOLS=${HEADAS} \ FTOOLSINPUT=stdin \ FTOOLSOUTPUT=stdout \ LHEASOFT=${HEADAS} \ LHEAPERL=/usr/bin/perl \ LHEA_DATA=${HEADAS}/refdata \ LHEA_HELP=${HEADAS}/help \ PFCLOBBER=1 \ EXT=lnx \ POW_LIBRARY=${HEADAS}/pow \ PATH=${HEADAS}/bin:$PATH \ LD_LIBRARY_PATH=${HEADAS}/lib:$LD_LIBRARY_PATH \ TCLRL_LIBDIR=${HEADAS}/lib \ PYTHONPATH=${HEADAS}/lib/python:$PYTHONPATH \ PFILES=/pfiles;${HEADAS}/syspfiles RUN mkdir /pfiles CMD ["/bin/bash"]