Commit e2575959 authored by Clemens Lange's avatar Clemens Lange
Browse files

Remove NoVNV/websockify including the additional python installation

parent b53a3aa6
......@@ -8,29 +8,13 @@ USER root
ADD vnc_utils.sh /usr/local/vnc_utils.sh
# install tigervnc server
RUN yum install -y tigervnc-server fluxbox xterm unzip && \
RUN yum install -y tigervnc-server fluxbox xterm && \
yum clean all && \
rm -rf /tmp/.X*
# Mind that this uses the patched (updated) version of curl
RUN export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${LD_LIBRARY_PATH} && \
/usr/local/bin/curl -ks https://api.github.com/repos/novnc/noVNC/releases/latest | \
grep -E 'tarball_url' | cut -d '"' -f 4 | xargs /usr/local/bin/curl -fksLJO && \
tar -C /usr/local -xvf novnc-noVNC*.tar.gz && \
rm novnc-noVNC*.tar.gz && \
ln -s /usr/local/novnc-noVNC-* /usr/local/novnc && \
/usr/local/bin/curl -ksOL https://github.com/novnc/websockify/archive/master.zip && \
unzip master.zip && \
rm master.zip && \
mv websockify-master /usr/local/novnc/utils/websockify
RUN echo "source /usr/local/vnc_utils.sh" >> /home/cmsusr/.bashrc && \
echo "source /usr/local/vnc_utils.sh" >> /home/cmsusr/.zshrc
# install python 2.7 if requested
COPY check_python_27.sh /tmp/
RUN chmod +x /tmp/check_python_27.sh && /tmp/check_python_27.sh ${GETPYTHON}
USER ${USERNAME}
WORKDIR /home/${USERNAME}
RUN mkdir -p /home/${USERNAME}/.vnc
......
#!/bin/bash
if [ -n "$1" ]; then
PY27VERSION=2.7.18
PY27NAME=Python-${PY27VERSION}
PY27INSTALL=/usr/local/python2.7
echo "Getting Python 2.7..."
cd /tmp
wget https://www.python.org/ftp/python/${PY27VERSION}/${PY27NAME}.tgz --no-check-certificate
tar -xzf ${PY27NAME}.tgz
rm -rf ${PY27NAME}.tgz
cd ${PY27NAME}
./configure --prefix=$PY27INSTALL --enable-shared
make
make altinstall
ln -s ${PY27INSTALL}/bin/python2.7 ${PY27INSTALL}/bin/python
# clean up
rm -rf ${PY27NAME}
fi
#!/bin/bash
start_vnc() {
# check for custom python
PY27INSTALL=/usr/local/python2.7
if [ -e ${PY27INSTALL}/bin/python ]; then
PATH=${PY27INSTALL}/bin:${PATH}
LD_LIBRARY_PATH=${PY27INSTALL}/lib:${LD_LIBRARY_PATH}
fi
nvnc=$((`vncserver -list | wc -l`-4))
vncname="myvnc:$(($nvnc+1))"
desktop="`hostname`:$(($nvnc+1))"
vncserver -geometry $GEOMETRY -name $vncname
export ORIGINAL_DISPLAY=$DISPLAY
export DISPLAY=$desktop
if [[ "${1}" == "verbose" ]]; then
/usr/local/novnc/utils/launch.sh --vnc 127.0.0.1:5901 &
else
/usr/local/novnc/utils/launch.sh --vnc 127.0.0.1:5901 > /dev/null 2>&1 &
fi
export NOVNCPID=$!
echo -e "VNC connection points:"
echo -e "\tVNC viewer address: 127.0.0.1:$((5900+$nvnc+1))"
echo -e "\tOSX built-in VNC viewer command: open vnc://127.0.0.1:$((5900+$nvnc+1))"
echo -e "\tWeb browser URL: http://127.0.0.1:6080/vnc.html?host=127.0.0.1&port=6080"
echo -e "\nTo stop noVNC enter 'pkill -9 -P $NOVNCPID'"
echo -e "To kill the vncserver enter 'vncserver -kill :$(($nvnc+1))'"
}
......@@ -33,15 +18,9 @@ stop_vnc() {
for i in $(seq 1 $nvnc); do
vncserver -kill :${i}
done
pkill -9 -P $NOVNCPID
unset NOVNCPID
export DISPLAY=$ORIGINAL_DISPLAY
}
clean_vnc() {
output=$(ps -p "$NOVNCPID")
if [[ "$?" -eq 0 ]]; then
stop_vnc
fi
rm ~/.vnc/*.log ~/.vnc/config ~/.vnc/passwd
stop_vnc
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment