Skip to content
Commits on Source (22)
FROM sarusso/basicmetadesktop:v0.2.0
FROM basicdesktop
MAINTAINER Stefano Alberto Russo <stefano.russo@gmail.com>
# Switch to root user
......
......@@ -24,6 +24,8 @@ fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" /bin/bash &
#python3 /home/metauser/astrocook/ac_gui.py
#twm &
fluxbox &
FROM ubuntu:20.04
MAINTAINER Stefano Alberto Russo <stefano.russo@inaf.it>
#----------------------
# Basics
#----------------------
# Set non-interactive
ENV DEBIAN_FRONTEND noninteractive
# Update first of all
RUN apt-get update
# Utilities
RUN apt-get install -y nano telnet unzip wget git-core sudo
# Change APT user to allow some container runtimes properly work (i.e. Podman)
RUN groupadd -g 600 _apt
RUN usermod -g 600 _apt
#------------------------
# "Meta" user
#------------------------
# Add group. We chose GID 1000 as default.
RUN groupadd -g 1000 metauser
# Add user. We chose UID 1000 as default
RUN useradd metauser -d /home/metauser -u 1000 -g 1000 -m -s /bin/bash
# Add metuaser user to sudoers
RUN adduser metauser sudo
# No pass sudo (for everyone, actually)
COPY files/sudoers /etc/sudoers
# Prepare for user-space logs
RUN mkdir /home/metauser/.logs && chown metauser:metauser /home/metauser/.logs
# Rename metauser home folder as a "vanilla" home folder
RUN mv /home/metauser /metauser_home_vanilla
# Set container name
ENV CONTAINER_NAME='base'
# Entrypoint
COPY files/base_entrypoint.sh /usr/bin/base_entrypoint.sh
RUN chmod 755 /usr/bin/base_entrypoint.sh
ENTRYPOINT ["/usr/bin/base_entrypoint.sh"]
ENV DEFAULT_ENTRYPOINT_COMMAND="/bin/bash"
# Allow to move the /home_vanilla folder in /home
RUN chmod 777 /home
# Set user
USER metauser
#!/bin/bash
docker build . -t base
......@@ -6,19 +6,17 @@ set -e
if [ "x$SAFE_MODE" == "xTrue" ]; then
echo ""
echo "[INFO] Not executing entrypoint as we are in safe mode, just opening a Bash shell."
exec /bin/bash
else
echo ""
echo "[INFO] Executing entrypoint..."
if [ "x$BASE_PORT" == "x" ]; then
echo "[INFO] No task base port set, will set noVNC port 8590 and VNC port 5900 with desktop id \"0\""
else
echo "[INFO] Task base port set, will set noVNC port $BASE_PORT and noVNC port $(($BASE_PORT+1)) with desktop id \"$(($BASE_PORT-5900+1))\""
fi
#---------------------
# Setup home
#---------------------
......@@ -34,7 +32,7 @@ else
if [ -e "$x" ]; then cp -a "$x" /home/metauser/; fi
done
# Mark as initialized
# Mark as initialized
touch /home/metauser/.initialized
fi
......@@ -42,7 +40,8 @@ else
echo "[INFO] Setting up HOME env var"
export HOME=/home/metauser
cd /home/metauser
#---------------------
# Save env
#---------------------
......@@ -61,48 +60,32 @@ else
fi
done
#---------------------
# Password
#---------------------
if [ "x$AUTH_PASS" != "x" ]; then
echo "[INFO] Setting up VNC password..."
else
echo "[INFO] Setting up default VNC password (metapassword)"
AUTH_PASS=metapass
fi
/usr/local/bin/kasmvncpasswd -f <<< $AUTH_PASS > /home/metauser/.kasmpasswd
chmod 600 /home/metauser/.kasmpasswd
export VNC_AUTH=True
# Storage link
#---------------------
if [ -e "/storages" ]; then
echo "[INFO] Creating link from /home/metauser/storages to /storages."
ln -s /storages /home/metauser/storages
fi
#---------------------
# User
# Prompt
#---------------------
if [ "x$AUTH_USER" != "x" ]; then
echo "[INFO] Setting up VNC user..."
sed -i -e "s/username=metauser/username=$AUTH_USER/" /home/metauser/.vnc/config
else
echo "[INFO] Setting up default VNC user (metauser)"
fi
echo "[INFO] Setting new prompt @$CONTAINER_NAME container"
echo 'export PS1="${debian_chroot:+($debian_chroot)}\u@$CONTAINER_NAME@\h:\w\$ "' >> /home/metauser/.bashrc
#---------------------
# Entrypoint command
#---------------------
if [ "$@x" == "x" ]; then
DEFAULT_COMMAND="supervisord -c /etc/supervisor/supervisord.conf"
echo -n "[INFO] Executing default entrypoint command: "
echo $DEFAULT_COMMAND
exec $DEFAULT_COMMAND
echo $DEFAULT_ENTRYPOINT_COMMAND
exec $DEFAULT_ENTRYPOINT_COMMAND
else
echo -n "[INFO] Executing entrypoint command: "
echo $@
......
#!/bin/bash
docker run -v$PWD/:/data -it base
FROM minimalmetadesktop
MAINTAINER Stefano Alberto Russo <stefano.russo@gmail.com>
FROM minimaldesktop
MAINTAINER Stefano Alberto Russo <stefano.russo@inaf.it>
# Switch to root
USER root
# Always start with an apt-get update when extending Reyns images,
# otherwise apt repositories might get outdated (404 not found)
# and building without cache does not re-build Reyns services.
RUN apt-get update
# Extra for 18.04
# Extra for Ubuntu18.04
RUN apt-get install net-tools dbus-x11 -y
#----------------------
# Xfce
#----------------------
RUN apt-get update
RUN apt-get install xfce4 xfce4-terminal mousepad ristretto tumbler firefox -y
# Replace X startup with version that uses Xfce as Window Manager
COPY files/xstartup /opt/tigervnc/
RUN chmod 755 /opt/tigervnc/xstartup
# X startup
COPY files/xstartup /opt/tigervnc/
RUN chmod 755 /opt/tigervnc/xstartup
RUN apt-get install xfce4 xfce4-terminal mousepad ristretto tumbler firefox gnome-flashback -y
#----------------------
......@@ -55,7 +41,7 @@ RUN chmod 755 /usr/bin/set_mouse_scrolling_speed
RUN chown -R metauser:metauser /metauser_home_vanilla/Desktop/
# Shorter bash prompt
#RUN echo "PS1=\"\u@MetaBox:\W $ \"" >> /metauser_home_vanilla/.bashrc
#RUN echo "PS1=\"\u@basicdesktop:\W $ \"" >> /metauser_home_vanilla/.bashrc
# Default conf (mostly eyecandy)
......@@ -73,27 +59,28 @@ RUN chmod 000 /usr/bin/xfce4-session-logout
# Create Downloads folder. This is "required" for showing proper spacing between icons in the filemanager a bounch
RUN mkdir /metauser_home_vanilla/Downloads && chown metauser:metauser /metauser_home_vanilla/Downloads
#----------------------
# Extra SW
#----------------------
RUN sudo apt-get install gdebi-core -y
COPY files/software/dropbox_2015.10.28_amd64.deb /root/
RUN gdebi /root/dropbox_2015.10.28_amd64.deb -n
# Extra SW
#RUN apt-get install libreoffice gimp -y
# Shell for temrinal
# Shell for terminal
COPY files/runshell.sh /bin/
RUN chmod 755 /bin/runshell.sh
# Set conatiner name for prompt
ENV CONTAINER_NAME='basicmetadesktop'
# Giveagain, since xfce install "fixed" it) write access to anyone to the home folder so the entrypoint
# will be able to copy over the /home/matauser_vanilla into /home/metauser (for Singularity)
#------------------------
# Post-intall
#------------------------
# Fix home permissions
RUN chmod 777 /home
# Switch back to metauser
USER metauser
# X environment startup
RUN mkdir -p /metauser_home_vanilla/.vnc
COPY files/xstartup /metauser_home_vanilla/.vnc
RUN chmod 755 /metauser_home_vanilla/.vnc/xstartup
# Set user
USER metauser
# Set container name
ENV CONTAINER_NAME='basicdesktop'
#!/bin/bash
docker build . -t basicdesktop