wine-vnc/Dockerfile

65 lines
1.9 KiB
Docker
Raw Normal View History

2024-02-23 10:23:27 +08:00
FROM ubuntu:jammy
LABEL maintainer="lxh@cxh.cn"
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
# 安装必要的工具
RUN apt-get update -y && \
2024-02-23 10:29:44 +08:00
apt-get install -y software-properties-common wget unzip git curl vim sudo net-tools
2024-02-23 10:23:27 +08:00
2024-02-23 10:29:44 +08:00
# 安装vnc和自动化相关工具
RUN apt-get install -y supervisor xvfb x11vnc fluxbox novnc xdotool
2024-02-23 10:23:27 +08:00
2024-02-23 10:29:44 +08:00
# 安装中文字体
2024-02-23 10:23:27 +08:00
RUN apt-get install -y ttf-wqy-microhei locales procps \
&& rm -rf /var/lib/apt/lists/* \
&& sed -ie 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/g' /etc/locale.gen \
&& locale-gen
# 安装 wine
RUN dpkg --add-architecture i386 && \
apt-get full-upgrade -y && \
wget -nc https://dl.winehq.org/wine-builds/winehq.key && \
apt-key add winehq.key && \
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ jammy main' && \
apt-get update -y && \
2024-02-24 10:59:47 +08:00
apt-get install -y --install-recommends winehq-stable winetricks && \
2024-02-23 10:23:27 +08:00
wine --version
2024-02-23 10:29:44 +08:00
# 配置运行环境等信息
2024-02-23 10:23:27 +08:00
ENV DISPLAY_WIDTH=1280 \
DISPLAY_HEIGHT=720 \
DISPLAY=:0.0 \
LANG=zh_CN.UTF-8 \
LANGUAGE=zh_CN.UTF-8 \
LC_ALL=zh_CN.UTF-8 \
WINEPREFIX=/home/app/.wine
2024-02-23 10:29:44 +08:00
# 复制配置文件
2024-02-23 10:23:27 +08:00
COPY etc/ /etc/
2024-02-23 10:29:44 +08:00
# 创建用户
2024-02-23 10:23:27 +08:00
RUN useradd -m app && usermod -aG sudo app && echo 'app ALL=(ALL) NOPASSWD:ALL' >> //etc/sudoers
USER app
WORKDIR /home/app
2024-02-24 11:24:32 +08:00
# 设置 VNC 密码
RUN mkdir ~/.vnc && x11vnc -storepasswd vncpass ~/.vnc/passwd
2024-02-24 10:59:47 +08:00
# 安装wine-mono和中文字体
2024-02-23 10:29:44 +08:00
COPY install-wine-mono.sh ./
2024-02-24 10:59:47 +08:00
COPY install-wine-chinese.sh ./
2024-02-23 10:23:27 +08:00
2024-02-23 10:29:44 +08:00
RUN bash -c 'sudo -E supervisord -c /etc/supervisord.conf -l /var/log/supervisord.log &' && \
sleep 5 && \
2024-02-24 10:59:47 +08:00
sudo chown -R app:app ./install-*.sh && \
2024-02-24 11:09:15 +08:00
sudo chmod +x ./install-*.sh && \
2024-02-23 10:29:44 +08:00
./install-wine-mono.sh && \
2024-02-24 10:59:47 +08:00
./install-wine-chinese.sh && \
sudo rm -rf ./install-*.sh
2024-02-23 16:18:05 +08:00
2024-02-23 10:23:27 +08:00
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]