# Linux-based build for a Windows desktop Quasar client (WinForms, .NET Framework 4.5.2)
# Note: This Linux-based multi-stage Dockerfile builds the Windows desktop client from source.
# The final image contains the built binaries, but the WinForms executable cannot run on Linux.
# This file demonstrates a build workflow intended for porting the project to a cross-platform stack.
FROM ubuntu:22.04 AS build
# Install Mono, NuGet and build tools
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
mono-complete \
nuget \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Restore NuGet packages for the Client and its dependencies
COPY Quasar.Common/Quasar.Common.csproj Quasar.Common/
COPY Quasar.Client/Quasar.Client.csproj Quasar.Client/
RUN nuget restore Quasar.Common/Quasar.Common.csproj
RUN nuget restore Quasar.Client/Quasar.Client.csproj
# Copy the rest of the source
COPY . .
# Build the client (best-effort; MSBuild may not be available in this image)
RUN if command -v msbuild >/dev/null 2>&1; then \
msbuild Quasar.Client/Quasar.Client.csproj /p:Configuration=Release; \
elif command -v xbuild >/dev/null 2>&1; then \
xbuild Quasar.Client/Quasar.Client.csproj /p:Configuration=Release; \
else \
echo "No MSBuild or XBuild found; skipping build"; \
fi
# Runtime image (minimal placeholder container that explains Windows-only runtime)
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy a small wrapper script that informs about Windows-only runtime
COPY wrapper.sh /wrapper.sh
RUN chmod +x /wrapper.sh
ENTRYPOINT ["/bin/bash", "/wrapper.sh"]