Enhance Dockerfile and entrypoint: update Wine installation process for improved security and add integration test script for Wine and .NET

This commit is contained in:
2025-07-07 00:53:45 +02:00
parent 0e663abb0a
commit 12091eb3bc
3 changed files with 40 additions and 13 deletions

View File

@@ -16,13 +16,14 @@ RUN apt update -y \
# Install Wine and dependencies
RUN dpkg --add-architecture i386 \
&& apt update -y \
&& apt install -y software-properties-common gnupg2 \
&& wget -qO - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/debian/ bullseye main" >> /etc/apt/sources.list.d/winehq.list \
&& apt install -y software-properties-common gnupg2 ca-certificates \
&& wget -qO - https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor -o /usr/share/keyrings/winehq-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] https://dl.winehq.org/wine-builds/debian/ bullseye main" >> /etc/apt/sources.list.d/winehq.list \
&& apt update -y \
&& apt install -y winehq-stable \
&& apt install -y winetricks \
&& apt install -y xvfb \
&& apt install -y xvfb cabextract \
&& wget -q https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O /usr/local/bin/winetricks \
&& chmod +x /usr/local/bin/winetricks \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
USER container
@@ -33,19 +34,13 @@ ENV WINEARCH=win64
ENV WINEPREFIX=/home/container/.wine
ENV DISPLAY=:99.0
# Initialize Wine prefix as container user
RUN Xvfb :99 -screen 0 1024x768x16 & \
export DISPLAY=:99.0 && \
wine --version && \
wineboot --init && \
winetricks -q corefonts && \
pkill Xvfb
WORKDIR /home/container
STOPSIGNAL SIGINT
COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh
COPY --chown=container:container ./../test-wine-dotnet.sh /test-wine-dotnet.sh
RUN chmod +x /entrypoint.sh
RUN chmod +x /test-wine-dotnet.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]