zhuhai111 commited on
Commit
3974a51
·
verified ·
1 Parent(s): 5bbd0a8

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -6
Dockerfile CHANGED
@@ -1,18 +1,23 @@
1
- FROM accetto/ubuntu-vnc-xfce-chromium
2
 
3
- USER root
4
 
 
5
  RUN apt-get update \
6
- && apt-get install -y python3 python3-pip build-essential \
7
- && pip3 install --upgrade pip \
8
- && pip3 install setuptools-rust wheel \
9
  && pip3 install paramiko \
10
  && apt-get clean \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
 
 
 
 
13
  COPY ssh_client.py /workspace/ssh_client.py
14
  COPY config.json /workspace/config.json
15
 
 
16
  WORKDIR /workspace
17
 
18
- CMD bash -c "python3 ssh_client.py -c config.json & exec /dockerstartup/vnc_startup.sh"
 
1
+ FROM ubuntu:20.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # 安装 LXDE、TigerVNC、Python3、pip 和依赖
6
  RUN apt-get update \
7
+ && apt-get install -y python3 python3-pip lxde tigervnc-standalone-server tigervnc-common dbus-x11 xfonts-base \
 
 
8
  && pip3 install paramiko \
9
  && apt-get clean \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # 创建 UID 1000 的用户 user,并设置权限
13
+ RUN useradd -m -u 1000 user \
14
+ && mkdir -p /home/user/.vnc /workspace \
15
+ && chown -R user:user /home/user /workspace
16
+
17
  COPY ssh_client.py /workspace/ssh_client.py
18
  COPY config.json /workspace/config.json
19
 
20
+ USER user
21
  WORKDIR /workspace
22
 
23
+ CMD bash -c "mkdir -p /home/user/.vnc && echo headless | vncpasswd -f > /home/user/.vnc/passwd && chmod 600 /home/user/.vnc/passwd && (python3 ssh_client.py -c config.json &) && vncserver :1 -geometry 1280x800 -depth 24 -localhost no -SecurityTypes None && tail -f /home/user/.vnc/*.log"