Spaces:
Running
Running
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/* | |
# 创建 1000 用户 | |
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 | |
# 启动 VNC 服务和 LXDE 桌面,并后台运行 ssh_client.py | |
CMD bash -c "vncserver :1 -geometry 1280x800 -depth 24 -localhost no -SecurityTypes None && (python3 ssh_client.py -c config.json &) && tail -f /home/user/.vnc/*.log" |