Commit ec24962d authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Added web-based X11 environment.

parent 6c0980ff
Loading
Loading
Loading
Loading

X11Web/Dockerfile

0 → 100644
+67 −0
Original line number Original line Diff line number Diff line
FROM base
MAINTAINER Stefano Alberto Russo <stefano.russo@inaf.it>

# Switch to root
USER root

#------------------------
# Supervisord
#------------------------

# In this container we need to use supervisord as we have two servoces (VNC and noVNC)

# Supervisord conf
COPY files/supervisord.conf /etc/supervisor/

# VNC supervisord conf
COPY files/supervisord_vnc.conf /etc/supervisor/conf.d/
COPY files/run_vnc.sh /etc/supervisor/conf.d/
RUN chmod 755 /etc/supervisor/conf.d/run_vnc.sh

# noVNC supervisord conf
COPY files/supervisord_novnc.conf /etc/supervisor/conf.d/
COPY files/run_novnc.sh /etc/supervisor/conf.d/
RUN chmod 755 /etc/supervisor/conf.d/run_novnc.sh


#------------------------
# VNC
#------------------------

# Install xvfb that triggers minimal install of X base packages and xterm as sample application
RUN apt-get install xvfb xterm net-tools -y

# Install base packages for VNC server and headless desktop (2)
COPY files/tigervnc-1.8.0.x86_64.tar.gz /opt/tigervnc-1.8.0.x86_64.tar.gz
RUN cd /opt && tar -zxvf tigervnc-1.8.0.x86_64.tar.gz && mv tigervnc-1.8.0.x86_64 tigervnc

# 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

# X environment setup/startup
COPY files/xstartup /opt/tigervnc/
RUN chmod 755 /opt/tigervnc/xstartup


#------------------------
# Post-intall
#------------------------

# Fix home permissions
RUN chmod 777 /home

# Set entrypoint command
ENV DEFAULT_ENTRYPOINT_COMMAND="supervisord -c /etc/supervisor/supervisord.conf"

# Set user
USER metauser

# Set container name
ENV CONTAINER_NAME='X11Web'


X11Web/build.sh

0 → 100755
+3 −0
Original line number Original line Diff line number Diff line
#!/bin/bash

docker build  . -t x11web
+12 −0
Original line number Original line Diff line number Diff line
<html>
<head>
<script type="text/javascript">
function redirecter(){
    window.location = "./vnc.html?autoconnect=true&resize=remote"
}
</script>
</head>
<body onLoad="redirecter()">
Access VNC: click <a href="./vnc.html?autoconnect=true&resize=remote">here</a>.
</body>
</html>
 No newline at end of file
+362 KiB

File added.

No diff preview for this file type.

+12 −0
Original line number Original line Diff line number Diff line
#!/bin/bash

# Exec TigerVNC server 

if [ "x$BASE_PORT" == "x" ]; then
    /usr/lib/noVNC/utils/launch.sh --listen 8590
    echo "Running noVNC on port 8590"
else
    /usr/lib/noVNC/utils/launch.sh --listen $BASE_PORT --vnc localhost:$(($BASE_PORT+1))
    echo "Running noVNC on port $BASE_PORT and connecting to VNC on port $(($BASE_PORT+1))"

fi
Loading