Update Dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
|
@@ -23,15 +23,15 @@
|
|
| 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 |
-
#
|
| 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 |
-
#
|
| 47 |
RUN pip3 install noVNC websockify
|
| 48 |
|
| 49 |
-
#
|
| 50 |
ENV USER=root
|
| 51 |
ENV DISPLAY=:1
|
| 52 |
ENV VNC_PASSWORD=password
|
| 53 |
|
| 54 |
-
#
|
| 55 |
RUN mkdir -p /root/.vnc && \
|
| 56 |
echo $VNC_PASSWORD | vncpasswd -f > /root/.vnc/passwd && \
|
| 57 |
chmod 600 /root/.vnc/passwd
|
| 58 |
|
| 59 |
-
#
|
| 60 |
EXPOSE 5901 6080
|
| 61 |
|
| 62 |
-
#
|
| 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"]
|