Compare commits
35 Commits
bd0c6a6eed
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b951a139a | |||
| dd68165b38 | |||
| 6fe3032136 | |||
| e755a61fa7 | |||
| d2099f3661 | |||
| 8cc1dcca5d | |||
| ba52f7fa11 | |||
| 26bcd42074 | |||
| 72f5f9500f | |||
| 34ba226952 | |||
| 65e658ce80 | |||
| be46b28bac | |||
| 77a5105695 | |||
| c8c901bd7f | |||
| 87a1ee9295 | |||
| 63e4af21c6 | |||
| 0e7416a9c6 | |||
| 8fc5c7c334 | |||
| ec3cb05297 | |||
| f0b007c6f9 | |||
| 12091eb3bc | |||
| 0e663abb0a | |||
| c96ccee9b8 | |||
| 683701d067 | |||
| e2b30b3f9e | |||
| 754eabf1e5 | |||
| e5c7731ecb | |||
| c7a5881445 | |||
| fefc086ed2 | |||
| a8c0bce094 | |||
| ca70979c85 | |||
| adc4393c88 | |||
| 5e696ad8c0 | |||
| 4e18d0fac1 | |||
| ee014e3c6d |
69
Dockerfile
69
Dockerfile
@@ -1,55 +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
|
||||
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/*
|
||||
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 \
|
||||
&& 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 wineuser
|
||||
USER wineuser
|
||||
WORKDIR /home/wineuser
|
||||
USER container
|
||||
ENV USER=container HOME=/home/container
|
||||
|
||||
# Initialize Wine prefix
|
||||
RUN winecfg /v
|
||||
WORKDIR /home/container
|
||||
|
||||
# Set Wine to 64-bit mode
|
||||
ENV WINEARCH=win64
|
||||
ENV WINEPREFIX=/home/wineuser/.wine
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
# 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"]
|
||||
COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
|
||||
CMD ["/entrypoint.sh"]
|
||||
70
README.md
70
README.md
@@ -1,70 +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
|
||||
|
||||
### 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
|
||||
16
build.ps1
16
build.ps1
@@ -1,16 +0,0 @@
|
||||
# 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
|
||||
}
|
||||
17
build.sh
17
build.sh
@@ -1,17 +0,0 @@
|
||||
#!/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
|
||||
21
entrypoint.sh
Normal file
21
entrypoint.sh
Normal 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}
|
||||
Reference in New Issue
Block a user