Skip to content

Instantly share code, notes, and snippets.

@rdpanek
Created August 13, 2020 07:56
Show Gist options
  • Save rdpanek/9768778e9f6420c07b8799b89913dd5d to your computer and use it in GitHub Desktop.
Save rdpanek/9768778e9f6420c07b8799b89913dd5d to your computer and use it in GitHub Desktop.
# https://raw.githubusercontent.com/ConSol/docker-headless-vnc-container/master/Dockerfile.ubuntu.xfce.vnc
#Dockerfile
FROM centos:8
MAINTAINER RDPanek "rdpanek@gmail.com"
LABEL io.k8s.description="VNC Container based on Centos" \
io.k8s.display-name="VNC Container based on Centos" \
io.openshift.expose-services="5901:xvnc" \
io.openshift.tags="vnc, centos, xfce" \
io.openshift.non-scalable=true
ENV DISPLAY=:1 \
VNC_PORT=5901
EXPOSE $VNC_PORT
### Envrionment config
ENV USER=root \
VNC_COL_DEPTH=24 \
VNC_RESOLUTION=1280x1024 \
VNC_PW=secret
### Install dependencies
RUN yum -y install epel-release && \
yum groupinstall "Xfce" -y && \
yum -y install tigervnc-server tigervnc-server-minimal && \
yum clean all
### Setup VNC
ADD ./scripts/xstartup /opt
RUN mkdir ~/.vnc && \
PASSWD_PATH=~/.vnc/passwd && \
echo $VNC_PW | vncpasswd -f >> $PASSWD_PATH && \
chmod 600 $PASSWD_PATH && \
mv /opt/xstartup ~/.vnc/xstartup && \
chmod +x ~/.vnc/xstartup
# entrypoint
#!/bin/bash
echo "ᐰ"
vncserver -geometry $VNC_RESOLUTION -depth $VNC_COL_DEPTH :1
tail -f /root/.vnc/*.log
# scripts/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment