Files
xserver-vnc/Dockerfile
T
2024-05-14 21:56:04 +02:00

58 lines
1.8 KiB
Docker

# syntax=docker/dockerfile:1
FROM ubuntu:jammy as base
ENV DEBIAN_FRONTEND=noninteractive
ENV PASSWORD=vnc4me
RUN apt-get update
# Build tools
RUN apt-get install -y dbus-x11 x11-xkb-utils xkb-data
RUN apt-get install -y python3
RUN apt-get install -y wget
RUN apt-get install -y git make gcc
RUN apt-get install -y icewm
RUN apt-get install -y x11-apps
RUN apt-get install -y bc
RUN apt-get install -y net-tools socat python3-numpy
FROM base as build
ADD https://github.com/TurboVNC/turbovnc/releases/download/3.1.1/turbovnc_3.1.1_amd64.deb /tmp/
ADD https://github.com/novnc/websockify.git /tmp/websockify
ADD https://github.com/novnc/noVNC.git /tmp/noVNC
WORKDIR "/tmp"
RUN dpkg -i turbovnc_3.1.1_amd64.deb
WORKDIR "/tmp/websockify"
RUN make -j4
ENV PATH=$PATH:/opt/TurboVNC/bin
RUN mkdir ~/.vnc/
RUN echo $PASSWORD | vncpasswd -f > ~/.vnc/passwd
RUN chmod 0600 ~/.vnc/passwd
EXPOSE 5900
COPY vnc/xstartup.turbovnc /etc/
COPY vnc/turbovncserver-security.conf /etc/
RUN chmod 0600 /etc/turbovncserver-security.conf
COPY vnc/turbovncserver.conf /etc/
COPY app/*.sh /app/
RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /tmp/novnc.key -out /tmp/novnc.pem -days 3650 -subj "/C=US/ST=NY/L=NY/O=NY/OU=NY/CN=NY emailAddress=email@example.com"
ENV DISPLAY_NUM=99
ENV DISPLAY=:${DISPLAY_NUM}
RUN touch /root/.Xauthority
ENTRYPOINT ["/app/app.sh"]
# https://dunedlin.wordpress.com/2020/10/24/a-minimal-x11-install/
# https://askubuntu.com/questions/1313445/how-do-i-install-vnc-on-a-headless-ubuntu-20-10
# https://github.com/mviereck/x11docker/wiki/How-to-access-X-over-TCP-IP-network
# https://jaydenm.com/blog/docker-x11-desktop/
# https://github.com/karinepires/docker-secure-vncserver/blob/master/Dockerfile
# https://github.com/theonemule/docker-opengl-turbovnc/blob/master/dockerfile
# MESA
# https://docs.mesa3d.org/install.html