# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later

# base
FROM ubuntu:22.04
RUN export DEBIAN_FRONTEND="noninteractive" && \
	apt-get update && \
	apt-get upgrade -y && \
    apt-get -y install \
      casacore-dev \
      g++-12  \
      git \
      libblas-dev \
      libboost-all-dev \
      libcfitsio-dev \
      libfftw3-dev \
      libgtkmm-3.0-dev \
      libhdf5-dev \
      liblapack-dev \
      libpng-dev \
      libpython3-dev \
      libxml2-dev \
      make \
      ninja-build \
  		python3-casacore \
      python3-pip \
      wcslib-dev \
      wget \
    && \
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip3 install \
		aptly-api-client \
		astropy \
		cmake \
		h5py \
		lofarantpos \
		matplotlib \
		numpy \
		pandas \
		scipy \
		tqdm \
    ;

ENV CC /usr/bin/gcc-12
ENV CXX /usr/bin/g++-12

# Putting the 2.5 GB LOBES coefficients in the docker image avoids downloading
# them in the jobs that use this image.
RUN mkdir -p /coeffs/lobes && \
  wget -P /coeffs/lobes -r -nH -nd --no-parent -A 'LOBES_*.h5' https://support.astron.nl/software/lobes/
