turbovnc / Dockerfile
Poweruser01's picture
Create Dockerfile
c8f4970 verified
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV USER=appuser
ENV HOME=/home/$USER
ENV DISPLAY=:1
ENV VNC_PORT=5901
ENV NOVNC_PORT=7860
# Install dependencies
RUN apt-get update && apt-get install -y \
wget gnupg curl supervisor fluxbox novnc websockify \
&& rm -rf /var/lib/apt/lists/*
# Install TurboVNC
RUN wget https://downloads.sourceforge.net/project/turbovnc/3.1.1/turbovnc_3.1.1_amd64.deb \
&& apt-get install -y ./turbovnc_3.1.1_amd64.deb \
&& rm turbovnc_3.1.1_amd64.deb
# Install Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" \
> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -s /bin/bash $USER
# Fluxbox config
RUN mkdir -p $HOME/.fluxbox
COPY fluxbox_menu $HOME/.fluxbox/menu
RUN chown -R $USER:$USER $HOME/.fluxbox
# Setup noVNC symlink
RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
# Copy scripts & configs
COPY start.sh $HOME/scripts/start.sh
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chmod +x $HOME/scripts/start.sh && chown -R $USER:$USER $HOME/scripts
USER $USER
WORKDIR $HOME
EXPOSE $NOVNC_PORT
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]