Skip to content
Dockerfile 1.69 KiB
Newer Older
FROM lofaruser/imaging-pipeline:v3.10

# Set non-interactive
ENV DEBIAN_FRONTEND noninteractive

# Always update when extending base images
RUN apt update


#------------------------
# Install deps
#------------------------

# Git, Curl, sudo and  Nano
RUN apt-get install git curl sudo nano -y

RUN cd /opt/ && git clone https://github.com/lofar-astron/LOFARBeam.git
RUN mkdir /opt/LOFARBeam/build && cd /opt/LOFARBeam/build && cmake -DCMAKE_INSTALL_PREFIX=/opt/lofarsoft -DPYTHON_EXECUTABLE=$(which python) -DCASACORE_INCLUDE_DIRS=/opt/lofarsoft/include/casacore/ -DCASACORE_LIBRARIES=/opt/lofarsoft/lib/ -DCASACORE_ROOT_DIR=/opt/lofarsoft/ ../ && make -j16 && make install 
#------------------------
# Lofar user
#------------------------

# Add group. We chose GID 65527 to try avoiding conflicts.
RUN groupadd -g 65527 lofar

# Add user. We chose UID 65527 to try avoiding conflicts.
RUN useradd lofar -d /home/lofar -u 65527 -g 65527 -m -s /bin/bash

# Add metuaser user to sudoers
RUN adduser lofar sudo

# No pass sudo (for everyone, actually)
COPY sudoers /etc/sudoers

# Setup home and input/output data directories
COPY data/input_data /input_data
COPY data/output_data /output_data
RUN chown lofar:lofar /home/lofar && chown -R lofar:lofar /input_data && chown -R lofar:lofar /output_data

# This is required mainly for Singularity
RUN mv /home/lofar /home/vanilla_lofar
RUN ln -s /tmp/lofarhome /home/lofar
RUN rm -rf /tmp/lofarhome


#----------------------
# Entrypoint
#----------------------

# Copy entrypoint
COPY entrypoint.sh /

# Give right permissions
RUN chmod 755 /entrypoint.sh

# Set entrypoint
ENTRYPOINT ["/entrypoint.sh"]

# Set user lofar
USER lofar

# Set container name
ENV CONTAINER_NAME='base3.10'