Newer
Older
Stefano Alberto Russo
committed
FROM lofar/lofar-pipeline:LOFAR-Release-4_0_16
Stefano Alberto Russo
committed
# 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
Stefano Alberto Russo
committed
Stefano Alberto Russo
committed
#------------------------
# 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
Stefano Alberto Russo
committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#----------------------
# Minimal Desktop
#----------------------
# Utilities
RUN apt-get install -y telnet unzip wget supervisor build-essential python-dev git-core openjdk-8-jre
# Global Supervisord conf
COPY files/supervisord.conf /etc/supervisor/
# Install xvfb that triggers minimal install of X base packages and xterm
RUN apt-get install xvfb xterm -y
# Install base packages for VNC server and headless desktop (2)
RUN cd /opt && wget https://bintray.com/tigervnc/stable/download_file?file_path=tigervnc-1.8.0.x86_64.tar.gz -O tigervnc-1.8.0.x86_64.tar.gz \
&& tar -zxvf tigervnc-1.8.0.x86_64.tar.gz \
&& mv tigervnc-1.8.0.x86_64 tigervnc
# Supervisord configuration
COPY files/supervisord_vnc.conf /etc/supervisor/conf.d/
COPY files/run_vnc.sh /etc/supervisor/conf.d/
COPY files/run_novnc.sh /etc/supervisor/conf.d/
RUN chmod 755 /etc/supervisor/conf.d/run_vnc.sh
RUN chmod 755 /etc/supervisor/conf.d/run_novnc.sh
# Web VNC (noVNC) v0.6.1.
# NOTE: this is a custom version from Doro Wu (fcwu.tw@gmail.com).
# TODO: Check differences and maybe move to 0.6.2
COPY files/noVNC.tar.gz /usr/lib/
RUN cd /usr/lib/ && tar -zxvf noVNC.tar.gz
COPY files/index.html /usr/lib/noVNC
RUN apt-get install -y net-tools
# Supervisord configuration
COPY files/supervisord_novnc.conf /etc/supervisor/conf.d/
# X environment setup/startup
RUN apt-get install fluxbox -y
COPY files/xstartup /opt/tigervnc/
RUN chmod 755 /opt/tigervnc/xstartup
# Prepare for logs
RUN mkdir /home/lofar/.logs && chown lofar:lofar /home/lofar/.logs
# Add fluxbox customisations
COPY files/dot_fluxbox /home/lofar/.fluxbox
RUN chown -R lofar:lofar /home/lofar/.fluxbox
COPY files/background.jpg /usr/share/images/fluxbox/background.jpg
# Rename lofar home folder as a "vanilla" home folder
RUN mv /home/lofar /lofar_home_vanilla
# Give write access to anyone to the home folder so the entrypoint will be able
# to copy over the /home/matauser_vanilla into /home/lofar (for Singularity)
RUN chmod 777 /home
Stefano Alberto Russo
committed
#----------------------
# 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
Stefano Alberto Russo
committed
ENV CONTAINER_NAME='base4.0.16'