BG5 commited on
Commit
062abf8
·
verified ·
1 Parent(s): e68a5b4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -23,15 +23,15 @@
23
  # Use the official Ubuntu image.
24
  FROM ubuntu:20.04
25
 
26
- # Set the timezone
27
  ENV TZ=Etc/UTC
28
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
29
 
30
- # Pre-seed the keyboard layout
31
  RUN echo "keyboard-configuration keyboard-configuration/layout select us" | debconf-set-selections
32
  RUN echo "keyboard-configuration keyboard-configuration/variant select English (US)" | debconf-set-selections
33
 
34
- # Install dependencies in non-interactive mode
35
  RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
36
  xfce4 \
37
  xfce4-goodies \
@@ -43,21 +43,21 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
43
  python3-pip \
44
  && rm -rf /var/lib/apt/lists/*
45
 
46
- # Install noVNC and websockify
47
  RUN pip3 install noVNC websockify
48
 
49
- # Set up VNC
50
  ENV USER=root
51
  ENV DISPLAY=:1
52
  ENV VNC_PASSWORD=password
53
 
54
- # Set up VNC server
55
  RUN mkdir -p /root/.vnc && \
56
  echo $VNC_PASSWORD | vncpasswd -f > /root/.vnc/passwd && \
57
  chmod 600 /root/.vnc/passwd
58
 
59
- # Expose VNC and noVNC ports
60
  EXPOSE 5901 6080
61
 
62
- # Start VNC server and noVNC
63
  CMD ["sh", "-c", "vncserver $DISPLAY -geometry 1280x800 -depth 24 && websockify --web=/usr/local/lib/python3.8/dist-packages/novnc/ 6080 localhost:5901"]
 
23
  # Use the official Ubuntu image.
24
  FROM ubuntu:20.04
25
 
26
+ # 设置时区
27
  ENV TZ=Etc/UTC
28
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
29
 
30
+ # 预设键盘布局
31
  RUN echo "keyboard-configuration keyboard-configuration/layout select us" | debconf-set-selections
32
  RUN echo "keyboard-configuration keyboard-configuration/variant select English (US)" | debconf-set-selections
33
 
34
+ # 安装依赖项(不安装 gdm3)
35
  RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
36
  xfce4 \
37
  xfce4-goodies \
 
43
  python3-pip \
44
  && rm -rf /var/lib/apt/lists/*
45
 
46
+ # 安装 noVNC websockify
47
  RUN pip3 install noVNC websockify
48
 
49
+ # 设置 VNC
50
  ENV USER=root
51
  ENV DISPLAY=:1
52
  ENV VNC_PASSWORD=password
53
 
54
+ # 设置 VNC 服务器
55
  RUN mkdir -p /root/.vnc && \
56
  echo $VNC_PASSWORD | vncpasswd -f > /root/.vnc/passwd && \
57
  chmod 600 /root/.vnc/passwd
58
 
59
+ # 暴露 VNC noVNC 端口
60
  EXPOSE 5901 6080
61
 
62
+ # 启动 VNC 服务器和 noVNC
63
  CMD ["sh", "-c", "vncserver $DISPLAY -geometry 1280x800 -depth 24 && websockify --web=/usr/local/lib/python3.8/dist-packages/novnc/ 6080 localhost:5901"]