mn9206986 commited on
Commit
baef4e5
·
verified ·
1 Parent(s): 052dafd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -13
Dockerfile CHANGED
@@ -1,9 +1,9 @@
1
  FROM debian:bookworm
2
  LABEL description="Chrome With noVNC" \
3
  maintainer="admin@fever.ink" \
4
- version="2.1"
5
 
6
- # Install Chrome
7
  RUN \
8
  apt update && \
9
  apt upgrade -y && \
@@ -12,25 +12,27 @@ RUN \
12
  apt install --no-install-recommends -f -y /tmp/google-chrome-stable_current_amd64.deb && \
13
  rm /tmp/google-chrome-stable_current_amd64.deb
14
 
15
- # Install VNC server and noVNC
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
- # Create directories and set permissions for non-root user
21
  RUN \
22
- mkdir -p /config/google-chrome /config/.vnc && \
23
- chmod -R 777 /config /opt/novnc && \
24
- touch /config/.vnc/passwd /config/.vnc/xstartup && \
25
- chmod 666 /config/.vnc/passwd /config/.vnc/xstartup
26
-
27
- # Copy and configure chrome-novnc.sh
 
 
28
  COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
29
  RUN \
30
  ln -s /opt/novnc/vnc.html /opt/novnc/index.html && \
31
  chmod +x /usr/bin/chrome-novnc.sh
32
 
33
- # Environment variables
34
  ENV \
35
  WIDTH=1280 \
36
  HEIGHT=720 \
@@ -38,13 +40,13 @@ ENV \
38
  VNC_PASSWD=Binhminh12 \
39
  HOME=/config \
40
  XDG_CONFIG_HOME=/config \
41
- VNC_DIR=/config/.vnc
42
 
43
  EXPOSE 7860
44
 
45
  VOLUME /config
46
 
47
- # Clean up
48
  RUN \
49
  apt purge -y git && \
50
  apt autoremove --purge -y && \
 
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 \
8
  apt update && \
9
  apt upgrade -y && \
 
12
  apt install --no-install-recommends -f -y /tmp/google-chrome-stable_current_amd64.deb && \
13
  rm /tmp/google-chrome-stable_current_amd64.deb
14
 
15
+ # Cài VNC server noVNC
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ục file 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
31
  RUN \
32
  ln -s /opt/novnc/vnc.html /opt/novnc/index.html && \
33
  chmod +x /usr/bin/chrome-novnc.sh
34
 
35
+ # Biến môi trường
36
  ENV \
37
  WIDTH=1280 \
38
  HEIGHT=720 \
 
40
  VNC_PASSWD=Binhminh12 \
41
  HOME=/config \
42
  XDG_CONFIG_HOME=/config \
43
+ VNC_DIR=/tmp/.vnc
44
 
45
  EXPOSE 7860
46
 
47
  VOLUME /config
48
 
49
+ # Dọn dẹp
50
  RUN \
51
  apt purge -y git && \
52
  apt autoremove --purge -y && \