commit bd0c6a6eed2ef042c9174703e149fa35e10c79c6 Author: B3ni Date: Sun Jul 6 23:50:39 2025 +0200 first commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..63aa7b0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,20 @@ +# Git files +.git +.gitignore + +# Documentation +README.md +*.md + +# IDE files +.vscode +.idea +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Logs +*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c1b8f49 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,55 @@ +# Use Ubuntu as base image for better Wine support +FROM ubuntu:22.04 + +# Avoid interactive prompts during installation +ENV DEBIAN_FRONTEND=noninteractive + +# Update system and install necessary packages +RUN apt-get update && apt-get install -y \ + software-properties-common \ + wget \ + curl \ + gnupg2 \ + ca-certificates \ + apt-transport-https \ + && rm -rf /var/lib/apt/lists/* + +# 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 \ + && rm -rf /var/lib/apt/lists/* + +# Create a wine user to avoid running as root +RUN useradd -m -s /bin/bash wineuser +USER wineuser +WORKDIR /home/wineuser + +# Initialize Wine prefix +RUN winecfg /v + +# Set Wine to 64-bit mode +ENV WINEARCH=win64 +ENV WINEPREFIX=/home/wineuser/.wine + +# Download and install .NET SDK +RUN cd /tmp \ + && wget https://builds.dotnet.microsoft.com/dotnet/Sdk/9.0.301/dotnet-sdk-9.0.301-win-x64.exe \ + && wine dotnet-sdk-9.0.301-win-x64.exe /quiet /install \ + && rm dotnet-sdk-9.0.301-win-x64.exe + +# Set environment variables for .NET +ENV DOTNET_ROOT="$WINEPREFIX/drive_c/Program Files/dotnet" +ENV PATH="$DOTNET_ROOT:$PATH" + +# Verify installation +RUN wine dotnet --version + +# Set working directory for projects +WORKDIR /home/wineuser/projects + +# Default command +CMD ["/bin/bash"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..e6cb674 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# 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 + +### Windows PowerShell-lel: +```powershell +.\build.ps1 +``` + +### 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: + +```bash +# .NET verzió ellenőrzése +wine dotnet --version + +# Új projekt létrehozása +wine dotnet new console -n MyApp + +# Projekt build-elése +cd MyApp +wine dotnet build + +# Projekt futtatása +wine dotnet run +``` + +## 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 +- A projektek a `/home/wineuser/projects` könyvtárban tárolhatók diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..203dc32 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,16 @@ +# Build the Docker image +Write-Host "Building Wine + .NET SDK Docker image..." -ForegroundColor Green +docker build -t wine-dotnet:latest . + +if ($LASTEXITCODE -eq 0) { + Write-Host "✅ Docker image built successfully!" -ForegroundColor Green + Write-Host "" + Write-Host "To run the container:" -ForegroundColor Yellow + Write-Host "docker run -it --rm wine-dotnet:latest" -ForegroundColor Cyan + Write-Host "" + Write-Host "To run with volume mounting (for development):" -ForegroundColor Yellow + Write-Host "docker run -it --rm -v ${PWD}/projects:/home/wineuser/projects wine-dotnet:latest" -ForegroundColor Cyan +} else { + Write-Host "❌ Failed to build Docker image" -ForegroundColor Red + exit 1 +} diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..f6bcf97 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Build the Docker image +echo "Building Wine + .NET SDK Docker image..." +docker build -t wine-dotnet:latest . + +if [ $? -eq 0 ]; then + echo "✅ Docker image built successfully!" + echo "To run the container:" + 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" +else + echo "❌ Failed to build Docker image" + exit 1 +fi