File size: 1,019 Bytes
49ea3f1
 
 
 
 
 
 
cfbd0f1
49ea3f1
 
 
 
 
4e856ac
cfbd0f1
49ea3f1
 
cfbd0f1
49ea3f1
 
 
455e0f1
 
e360533
043b83d
279a556
cfbd0f1
 
 
 
 
49ea3f1
4e856ac
cfbd0f1
2953ec9
d5805b6
49ea3f1
 
 
 
 
455e0f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    xfce4 xfce4-goodies \
    tightvncserver \
    xfonts-base \
    novnc websockify \
    curl wget git python3 \
    sudo net-tools iputils-ping \
    && apt-get clean

RUN ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html

RUN useradd -m -u 1000 user
USER user
ENV USER=user
ENV HOME=/home/user
WORKDIR $HOME

RUN --mount=type=secret,id=VNC_PASS,mode=0444,required=true \
    mkdir -p $HOME/.vnc && \
    echo "$(cat /run/secrets/VNC_PASS)" | vncpasswd -f > $HOME/.vnc/passwd && \
    chmod 600 $HOME/.vnc/passwd

RUN echo "#!/bin/sh\n\
xrdb \$HOME/.Xresources\n\
startxfce4 &" > $HOME/.vnc/xstartup && \
    chmod +x $HOME/.vnc/xstartup
    
RUN echo "#!/bin/bash\n\
export USER=user\n\
export HOME=/home/user\n\
vncserver :1 -geometry 1366x768 -depth 24\n\
/usr/share/novnc/utils/launch.sh --vnc localhost:5901 --listen 7860" > $HOME/start.sh

RUN chmod +x $HOME/start.sh

EXPOSE 7860

CMD ["./start.sh"]