Compare commits

..

26 Commits

Author SHA1 Message Date
2b951a139a Refactor entrypoint script by removing Wine setup and testing code 2025-07-07 18:23:12 +02:00
dd68165b38 Add SUBNAUTICA_INSTALLATION_PATH environment variable to entrypoint script 2025-07-07 16:16:03 +02:00
6fe3032136 Remove SUBNAUTICA_INSTALLATION_PATH export from entrypoint script 2025-07-07 14:52:54 +02:00
e755a61fa7 Fix capitalization of SUBNAUTICA_INSTALLATION_PATH in entrypoint script 2025-07-07 14:45:03 +02:00
d2099f3661 Add SUBNAUTICA_INSTALLATION_PATH environment variable to entrypoint script 2025-07-07 14:43:34 +02:00
8cc1dcca5d Fix Wine initialization and .NET installation commands to ensure successful execution 2025-07-07 14:33:47 +02:00
ba52f7fa11 Refactor Dockerfile: improve formatting and readability of Wine and .NET installation commands 2025-07-07 14:30:55 +02:00
26bcd42074 Refactor Dockerfile: improve Wine initialization and .NET installation commands for better readability and reliability 2025-07-07 14:29:45 +02:00
72f5f9500f Refactor Dockerfile: streamline Wine initialization and .NET installation process 2025-07-07 14:28:58 +02:00
34ba226952 Refactor Dockerfile and entrypoint script: streamline .NET installation process in Wine and enhance Wine prefix initialization 2025-07-07 14:22:33 +02:00
65e658ce80 Enhance entrypoint script: add installation of .NET Runtime and SDK for Windows in Wine 2025-07-07 14:19:02 +02:00
be46b28bac Refactor entrypoint script: reinitialize Wine prefix and streamline initialization process with timeout and testing 2025-07-07 14:17:18 +02:00
77a5105695 Refactor Dockerfile: switch Wine installation from development to stable version 2025-07-07 14:12:34 +02:00
c8c901bd7f Refactor Dockerfile and entrypoint script: update DotNet installation process, switch to Wine development version, and streamline Wine initialization 2025-07-07 14:07:45 +02:00
87a1ee9295 Refactor entrypoint script: enhance Wine initialization with timeout and improve error handling for Wine test 2025-07-07 14:01:19 +02:00
63e4af21c6 Enhance entrypoint script: increase wait time for Xvfb, streamline Wine initialization, and improve Wine test handling 2025-07-07 13:59:50 +02:00
0e7416a9c6 Refactor entrypoint script: simplify X11 permissions handling by removing unnecessary sudo commands 2025-07-07 13:58:35 +02:00
8fc5c7c334 Refactor entrypoint script: enhance X11 permissions handling, streamline Wine initialization, and improve error handling for Wine test 2025-07-07 13:57:52 +02:00
ec3cb05297 Refactor entrypoint script: enhance Wine initialization process and remove obsolete test script 2025-07-07 13:56:13 +02:00
f0b007c6f9 Enhance entrypoint script: add wait time for Xvfb and ensure Wine components are installed correctly during initialization 2025-07-07 13:43:31 +02:00
12091eb3bc Enhance Dockerfile and entrypoint: update Wine installation process for improved security and add integration test script for Wine and .NET 2025-07-07 00:53:45 +02:00
0e663abb0a Refactor Dockerfile and entrypoint: switch to a new base image, streamline .NET SDK installation, and enhance entrypoint script for better environment setup 2025-07-07 00:47:32 +02:00
c96ccee9b8 Enhance Dockerfile: improve .NET SDK installation command to ensure successful execution with multiple options 2025-07-07 00:38:49 +02:00
683701d067 Enhance Dockerfile: improve .NET SDK download process with progress bar and remove redundant checks 2025-07-07 00:34:02 +02:00
e2b30b3f9e Refactor Dockerfile: simplify default command to use non-login shell 2025-07-07 00:32:43 +02:00
754eabf1e5 Enhance Dockerfile: add progress bar for .NET SDK download and ensure file integrity before proceeding 2025-07-07 00:32:32 +02:00
4 changed files with 42 additions and 189 deletions

View File

@@ -1,99 +1,28 @@
# Use Ubuntu as base image for better Wine support
FROM ubuntu:22.04
FROM --platform=$TARGETOS/$TARGETARCH ghcr.io/parkervcp/yolks:debian
# Avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
LABEL author="Torsten Widmann" maintainer="info@goover.de"
# Update system and install necessary packages including X11 for Wine
RUN apt-get update && apt-get install -y \
software-properties-common \
wget \
curl \
gnupg2 \
ca-certificates \
apt-transport-https \
xvfb \
x11-utils \
x11-xserver-utils \
dbus-x11 \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=noninteractive
# Add Wine repository and install Wine 64-bit
RUN dpkg --add-architecture i386 \
&& mkdir -pm755 /etc/apt/keyrings \
&& wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key \
&& wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources \
&& apt-get update \
&& apt-get install -y --install-recommends winehq-stable \
&& apt-get install -y winetricks \
&& rm -rf /var/lib/apt/lists/*
RUN apt update -y \
&& apt upgrade -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/9.0 | grep -i '<h3 id="sdk-9.*">SDK 9.*.*</h3>' | head -1 | awk -F\" '{print $3}' | awk '{print $2;}' | sed 's/<\/h3>//g')" \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh -i /usr/share -v $D_V \
&& ln -s /usr/share/dotnet /usr/bin/dotnet \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# Create a wine user to avoid running as root
RUN useradd -m -s /bin/bash -u 1000 wineuser
USER wineuser
WORKDIR /home/wineuser
USER container
ENV USER=container HOME=/home/container
# Set Wine to 64-bit mode
ENV WINEARCH=win64
ENV WINEPREFIX=/home/wineuser/.wine
ENV DISPLAY=:99
ENV WINEDLLOVERRIDES="mscoree,mshtml="
ENV WINEDEBUG=-all
WORKDIR /home/container
# Create necessary directories and set up environment
USER root
RUN mkdir -p /tmp/.X11-unix /run/user/1000 \
&& chmod 1777 /tmp/.X11-unix \
&& chown wineuser:wineuser /run/user/1000
USER wineuser
STOPSIGNAL SIGINT
# Set additional environment variables
ENV XDG_RUNTIME_DIR=/run/user/1000
# Create X11 directory and initialize Wine prefix
RUN Xvfb :99 -screen 0 1024x768x16 & \
XVFB_PID=$! \
&& sleep 3 \
&& wineboot --init \
&& sleep 5 \
&& wineserver --wait \
&& kill $XVFB_PID || true
# Install Wine dependencies for .NET
RUN Xvfb :99 -screen 0 1024x768x16 & \
XVFB_PID=$! \
&& sleep 3 \
&& winetricks -q corefonts vcrun2019 \
&& wineserver --wait \
&& kill $XVFB_PID || true
# Download and install .NET SDK with virtual display
RUN cd /tmp \
&& wget https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.301/dotnet-sdk-9.0.301-win-x64.exe \
&& echo "Download completed, file size: $(ls -lh dotnet-sdk-9.0.301-win-x64.exe)" \
&& sleep 2 \
&& Xvfb :99 -screen 0 1024x768x16 & \
XVFB_PID=$! \
&& sleep 3 \
&& wine dotnet-sdk-9.0.301-win-x64.exe /quiet \
&& wineserver --wait \
&& kill $XVFB_PID || true \
&& rm dotnet-sdk-9.0.301-win-x64.exe || true
# Set environment variables for .NET
ENV DOTNET_ROOT="$WINEPREFIX/drive_c/Program Files/dotnet"
ENV PATH="$DOTNET_ROOT:$PATH"
# Get dotnet version to verify installation
RUN Xvfb :99 -screen 0 1024x768x16 & \
XVFB_PID=$! \
&& sleep 3 \
&& wine dotnet --version \
&& wineserver --wait \
&& kill $XVFB_PID || true
# Set working directory for projects
WORKDIR /home/wineuser/projects
# Default command
CMD ["/bin/bash", "-l"]
COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]

View File

@@ -1,76 +0,0 @@
# Wine + .NET SDK Docker Image
Ez a Docker image telepíti a Wine 64-bit verzióját és a Microsoft .NET SDK 9.0.301-et Windows-on keresztül.
## Tartalom
- Ubuntu 22.04 alapú image
- Wine 64-bit (stable verzió)
- .NET SDK 9.0.301 (Windows x64)
## Build
### Bash-sel (Git Bash, WSL, Linux, macOS):
```bash
chmod +x build.sh
./build.sh
```
### Manuálisan:
```bash
docker build -t wine-dotnet:latest .
```
## Használat
### Alapvető futtatás:
```bash
docker run -it --rm wine-dotnet:latest
```
### Projektekkel való munka (volume mounting):
```bash
docker run -it --rm -v $(pwd)/projects:/home/wineuser/projects wine-dotnet:latest
```
Windows PowerShell-ben:
```powershell
docker run -it --rm -v ${PWD}/projects:/home/wineuser/projects wine-dotnet:latest
```
## .NET használata a containerben
A containerben belül használhatod a .NET SDK-t a speciális script segítségével:
```bash
# .NET verzió ellenőrzése
./run-dotnet.sh --version
# Új projekt létrehozása
./run-dotnet.sh new console -n MyApp
# Projekt build-elése
cd MyApp
../run-dotnet.sh build
# Projekt futtatása
../run-dotnet.sh run
```
Alternatívaként közvetlenül is használhatod:
```bash
# Virtual display indítása
Xvfb :99 -screen 0 1024x768x16 &
export DISPLAY=:99
# .NET parancsok
wine dotnet --version
```
## Megjegyzések
- A container egy `wineuser` felhasználóval fut (nem root)
- A Wine prefix előre konfigurálva van 64-bit módban
- A .NET SDK csendben telepítve van virtual display segítségével
- A projektek a `/home/wineuser/projects` könyvtárban tárolhatók
- A `run-dotnet.sh` script automatikusan kezeli a virtual display-t

View File

@@ -1,21 +0,0 @@
#!/bin/bash
echo "Building Wine + .NET SDK Docker image..."
docker build -t wine-dotnet:latest .
if [ $? -eq 0 ]; then
echo "✅ Docker image built successfully!"
echo ""
echo "To run the container interactively:"
echo "docker run -it --rm wine-dotnet:latest"
echo ""
echo "To run with volume mounting (for development):"
echo "docker run -it --rm -v \$(pwd)/projects:/home/wineuser/projects wine-dotnet:latest"
echo ""
echo "To run a .NET application with Wine:"
echo "docker run -it --rm -v \$(pwd)/projects:/home/wineuser/projects wine-dotnet:latest"
echo "Then inside the container: wine dotnet YourApp.dll"
else
echo "❌ Failed to build Docker image"
exit 1
fi

21
entrypoint.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
cd /home/container
# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP
# DotNet environment setup
export DOTNET_ROOT=/usr/share/
export SUBNAUTICA_INSTALLATION_PATH=/home/container/Subnautica
# Print versions
printf "\033[1m\033[33mcontainer@pelican~ \033[0mdotnet --version\n"
dotnet --version
# Replace Startup Variables
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo -e ":/home/container$ ${MODIFIED_STARTUP}"
# Run the Server
eval ${MODIFIED_STARTUP}