Sign inSign up

lczws/my-desktop

By lczws

•Updated 6 months ago

Image
0

193

lczws/my-desktop repository overview

Dockerfile:

# 基础镜像
FROM debian:unstable

ENV DEBIAN_FRONTEND=noninteractive

# 安装基本组件(去掉 sumo,后面单独装)
RUN apt-get update && apt-get install -y \
    xfce4 xfce4-goodies x11vnc xvfb \
    firefox wget curl net-tools sudo git \
    python3 python3-pip supervisor \
    dbus-x11 \
    gnupg \
    fontconfig \
    fonts-dejavu-core \
    fonts-liberation \
    fonts-noto-cjk

# 添加 SUMO 仓库并安装 sumo
RUN echo 'deb http://download.opensuse.org/repositories/science:/dlr/Debian_Unstable/ /' \
        | tee /etc/apt/sources.list.d/science:dlr.list \
    && curl -fsSL https://download.opensuse.org/repositories/science:dlr/Debian_Unstable/Release.key \
        | gpg --dearmor \
        | tee /etc/apt/trusted.gpg.d/science_dlr.gpg > /dev/null \
    && apt-get update \
    && apt-get install -y sumo

# 在Dockerfile中添加启动D-Bus的步骤
RUN mkdir -p /run/dbus
RUN dbus-daemon --system

# 设置默认分辨率
ENV DISPLAY=:1
ENV RESOLUTION=1920x1080

# 下载 noVNC 和 websockify(源码)
WORKDIR /opt
RUN git clone https://github.com/novnc/noVNC /opt/noVNC \
    && git clone https://github.com/novnc/websockify /opt/websockify \
    && chmod +x /opt/websockify/run \
    && ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html

# 设置 VNC 密码
RUN mkdir -p /home/docker/.vnc \
    && x11vnc -storepasswd 114514 /home/docker/.vnc/passwd

# 复制 supervisord 配置文件
COPY supervisord.conf /etc/supervisor/conf.d/vnc.conf

WORKDIR /root

EXPOSE 6080

CMD ["/usr/bin/supervisord", "-n"]

supervisord.conf

[program:xvfb]
command=/usr/bin/Xvfb :1 -screen 0 1920x1080x24
autostart=true
autorestart=true
 
[program:x11vnc]
command=/usr/bin/x11vnc -display :1 -passwd 114514 -forever -shared
autostart=true
autorestart=true
 
[program:startxfce4]
command=/usr/bin/dbus-run-session -- /usr/bin/startxfce4
environment=DISPLAY=":1",DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
autostart=true
autorestart=true
 
[program:novnc]
command=/opt/websockify/run 0.0.0.0:6080 localhost:5900 --web=/opt/noVNC
autostart=true
autorestart=true
docker run -d -it -p 6080:6080 -v /workspace/Desktop:/root/Desktop --name my-desktop lczws/my-desktop

Tag summary

Content type

Image

Digest

sha256:792153c32…

Size

1000.9 MB

Last updated

6 months ago

docker pull lczws/my-desktop:v1