mn9206986 commited on
Commit
e178ced
·
verified ·
1 Parent(s): 6414ca9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -12
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM debian:bookworm
2
  LABEL description="Chrome With noVNC" \
3
  maintainer="admin@fever.ink" \
4
- version="2.2"
5
 
6
  # Cài Chrome
7
  RUN \
@@ -17,14 +17,16 @@ RUN \
17
  apt install --no-install-recommends -y tightvncserver xfonts-base git websockify python3 net-tools procps && \
18
  git clone https://github.com/novnc/noVNC.git /opt/novnc
19
 
20
- # Tạo thư mụcfile với quyền phù hợp
21
  RUN \
22
- mkdir -p /config/google-chrome /tmp/.vnc /tmp/.X11-unix && \
23
- touch /config/google-chrome/First\ Run /tmp/.vnc/passwd /tmp/.vnc/xstartup && \
24
- chmod -R 777 /config /tmp/.vnc /tmp/.X11-unix /opt/novnc && \
25
- echo "Binhminh" | vncpasswd -f > /tmp/.vnc/passwd && \
26
- echo "#!/bin/sh\nunset SESSION_MANAGER\nunset DBUS_SESSION_BUS_ADDRESS\nwhile [ 1 ]; do /opt/google/chrome/google-chrome --test-type --window-size=$((WIDTH+1)),$((HEIGHT+1)) --no-sandbox --window-position=0,0 --user-data-dir=/config/google-chrome; done" > /tmp/.vnc/xstartup && \
27
- chmod 700 /tmp/.vnc/xstartup
 
 
28
 
29
  # Copy và cấu hình chrome-novnc.sh
30
  COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
@@ -37,10 +39,10 @@ ENV \
37
  WIDTH=1280 \
38
  HEIGHT=720 \
39
  LANGUAGE=zh_CN.UTF-8 \
40
- VNC_PASSWD=Binhminh12 \
41
- HOME=/config \
42
- XDG_CONFIG_HOME=/config \
43
- VNC_DIR=/tmp/.vnc
44
 
45
  EXPOSE 7860
46
 
@@ -52,4 +54,5 @@ RUN \
52
  apt autoremove --purge -y && \
53
  rm -rf /var/lib/apt/lists/*
54
 
 
55
  CMD ["bash", "-c", "/usr/bin/chrome-novnc.sh"]
 
1
  FROM debian:bookworm
2
  LABEL description="Chrome With noVNC" \
3
  maintainer="admin@fever.ink" \
4
+ version="2.3"
5
 
6
  # Cài Chrome
7
  RUN \
 
17
  apt install --no-install-recommends -y tightvncserver xfonts-base git websockify python3 net-tools procps && \
18
  git clone https://github.com/novnc/noVNC.git /opt/novnc
19
 
20
+ # Tạo user nobodythư mục với quyền phù hợp
21
  RUN \
22
+ mkdir -p /config/google-chrome /home/nobody/.vnc && \
23
+ touch /config/google-chrome/First\ Run /home/nobody/.vnc/passwd /home/nobody/.vnc/xstartup && \
24
+ echo "Binhminh" | vncpasswd -f > /home/nobody/.vnc/passwd && \
25
+ echo "#!/bin/sh\nunset SESSION_MANAGER\nunset DBUS_SESSION_BUS_ADDRESS\nwhile [ 1 ]; do /opt/google/chrome/google-chrome --test-type --window-size=$((WIDTH+1)),$((HEIGHT+1)) --no-sandbox --window-position=0,0 --user-data-dir=/config/google-chrome; done" > /home/nobody/.vnc/xstartup && \
26
+ chmod -R 777 /config /opt/novnc && \
27
+ chmod 600 /home/nobody/.vnc/passwd && \
28
+ chmod 700 /home/nobody/.vnc/xstartup && \
29
+ chown -R nobody:nogroup /home/nobody /config
30
 
31
  # Copy và cấu hình chrome-novnc.sh
32
  COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
 
39
  WIDTH=1280 \
40
  HEIGHT=720 \
41
  LANGUAGE=zh_CN.UTF-8 \
42
+ VNC_PASSWD=Binhminh \
43
+ HOME=/home/nobody \
44
+ XDG_CONFIG_HOME=/home/nobody \
45
+ VNC_DIR=/home/nobody/.vnc
46
 
47
  EXPOSE 7860
48
 
 
54
  apt autoremove --purge -y && \
55
  rm -rf /var/lib/apt/lists/*
56
 
57
+ USER nobody
58
  CMD ["bash", "-c", "/usr/bin/chrome-novnc.sh"]