Spaces:
Paused
Paused
| FROM ubuntu:20.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 安装 LXDE、TigerVNC、Python3、pip 和依赖 | |
| RUN apt-get update \ | |
| && apt-get install -y python3 python3-pip lxde tigervnc-standalone-server tigervnc-common dbus-x11 xfonts-base \ | |
| && pip3 install paramiko \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 创建 UID 1000 的用户 user,并设置权限 | |
| RUN useradd -m -u 1000 user \ | |
| && mkdir -p /home/user/.vnc /workspace \ | |
| && chown -R user:user /home/user /workspace | |
| COPY ssh_client.py /workspace/ssh_client.py | |
| COPY config.json /workspace/config.json | |
| USER user | |
| WORKDIR /workspace | |
| 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" | |