From a8c0bce0947a6dad214d8024355a77a8b681cf9e Mon Sep 17 00:00:00 2001 From: b3ni15 Date: Mon, 7 Jul 2025 00:28:17 +0200 Subject: [PATCH] Refactor Dockerfile and build script: streamline .NET SDK installation and update run instructions --- Dockerfile | 5 ++--- build.sh | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d04e1b5..d71ed98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,8 +75,7 @@ RUN cd /tmp \ && 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 + && kill $XVFB_PID || true # Set environment variables for .NET ENV DOTNET_ROOT="$WINEPREFIX/drive_c/Program Files/dotnet" @@ -94,4 +93,4 @@ RUN Xvfb :99 -screen 0 1024x768x16 & \ WORKDIR /home/wineuser/projects # Default command -CMD ["/bin/bash"] +CMD ["/bin/bash", "-l"] diff --git a/build.sh b/build.sh index f6bcf97..f324532 100644 --- a/build.sh +++ b/build.sh @@ -6,11 +6,16 @@ docker build -t wine-dotnet:latest . if [ $? -eq 0 ]; then echo "✅ Docker image built successfully!" - echo "To run the container:" + 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