File size: 817 Bytes
c26ba27
badde30
c26ba27
badde30
c26ba27
 
 
badde30
 
 
 
c26ba27
badde30
 
 
 
 
 
 
 
 
 
c26ba27
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"