build-automation-scripting
Summary
Automate multi-stage Docker builds for cross-platform deployment of Windows-only .NET Framework applications using BuildKit optimization and resource-constrained orchestration. This skill enables reproducible, CI/CD-ready containerization of GUI and CLI variants with Wine runtime integration for non-Windows host execution.
When to use
When you have a Windows-only .NET Framework 4.8 application (GUI or CLI) that must run on macOS or Linux hosts, and you need a reproducible, version-controlled build pipeline that generates separate runtime targets (native Windows, Linux+Wine, CLI-only, development) without manual compilation steps on each target OS.
When NOT to use
- Input application is already compiled to x86_64 Linux binaries or native .NET Core — use containerization without Wine or multi-stage builds.
- Target deployment is Windows-only — native Windows binary or simpler Docker image for Windows containers is more efficient.
- Build resource constraints on the CI/CD host are < 2GB memory or single-core — the 8GB/4-core requirement will cause OOM or timeout failures.
Inputs
- .NET Framework 4.8 C# source code
- Dockerfile with multi-stage configuration
- docker-compose.yml with resource limits and service definitions
- build-docker.sh automation script
- ProteoWizard dependencies (pwiz_bindings_cli.dll)
- Wine configuration templates (if pre-built)
Outputs
- Docker image (runtime-windows target)
- Docker image (runtime-linux target with Wine integration)
- Docker image (runtime-cli target, headless)
- Docker image (runtime-dev target, debug-enabled)
- docker-compose environment file
- Build validation log confirming all stages compiled without error
How to apply
Create a multi-stage Dockerfile that decouples the build stage (Ubuntu 22.04 base, .NET Framework SDK, C# compilation from source) from runtime stages (Wine+Windows compatibility libraries, .NET Framework 4.8 runtime, GUI/CLI environment configuration). Enable DOCKER_BUILDKIT=1 for optimization and define resource limits (8GB memory, 4 cores CPU) in docker-compose.yml. Configure Wine prefix initialization and separate build targets using Docker build stages: runtime-windows (native Windows execution), runtime-linux (Wine-based Linux execution), runtime-cli (headless CLI variant), and runtime-dev (development mode with debug symbols). Execute the build-docker.sh script to compile all targets. Validate that each Docker image target builds without error and the configuration test passes (typically via health check validation or container startup verification).
Related tools
- Docker Desktop for Mac (Container runtime and build orchestration environment for multi-stage builds on macOS) — https://www.docker.com/products/docker-desktop
- Docker Engine (Container runtime for building and executing multi-stage Docker images on Linux hosts) — https://docs.docker.com/engine/
- Wine (Windows compatibility layer providing runtime environment for .NET Framework 4.8 and Windows GUI in Linux containers) — https://www.winehq.org/
- .NET Framework 4.8 (Target runtime library compiled into Docker image runtime stage for executing AirdPro C# GUI and CLI binaries)
- ProteoWizard (Dependency library (pwiz_bindings_cli.dll) providing vendor format file I/O for AirdPro conversion logic) — https://github.com/CSi-Studio/AirdPro
- XQuartz (X11 server for forwarding GUI display from Wine-based containers to macOS host)
Examples
export DOCKER_BUILDKIT=1; ./build-docker.sh; docker run --rm -v airdpro-data:/data airdpro:runtime-linux config-test
Evaluation signals
- All four Docker image targets (runtime-windows, runtime-linux, runtime-cli, runtime-dev) build successfully with no compilation errors in the build-docker.sh output log.
- Configuration test passes:
docker run --rm <image> config-test or equivalent health check returns exit code 0.
- Docker image size for runtime-linux target is < 2GB (Wine + .NET Framework overhead is typical; significant deviation indicates bloat or missing layer optimization).
- Container starts without 'OutOfMemory' or resource allocation failures when docker-compose.yml memory limit (8GB) and CPU limit (4 cores) are applied via
docker inspect or docker stats.
- GUI variant runs without Wine or X11 socket errors when invoked with
xhost +local:docker and DISPLAY forwarding enabled; CLI variant executes without X11 dependency.
Limitations
- Multi-stage builds increase total build time (first build may take 20+ minutes) due to .NET Framework SDK download, compilation, and Wine environment setup in container.
- Wine runtime introduces a ~5–10% performance overhead compared to native Windows execution; CPU-intensive conversions may be slower than native .NET Framework 4.8 on Windows.
- GUI rendering via Wine + X11 forwarding to macOS (via XQuartz) may encounter display glitches or color space mismatches; headless CLI variant is more reliable for batch processing.
- ProteoWizard vendor format support depends on pwiz_bindings_cli.dll version and Wine's ability to load Windows DLLs; format support matrix does not expand beyond what ProteoWizard upstream supports.
- BuildKit optimization requires DOCKER_BUILDKIT=1 environment variable; older Docker versions or CI/CD systems may not support this feature, requiring fallback to classic build mode.
Evidence
- [other] AirdPro is a C# GUI client written for .NET Framework 4.8 that requires a multi-stage Docker build configuration pairing application compilation with Wine runtime to run Windows applications in Linux containers.: "AirdPro is a C# GUI client written for .NET Framework 4.8 that requires a multi-stage Docker build configuration pairing application compilation with Wine runtime to run Windows applications in Linux"
- [other] 1. Create a multi-stage Dockerfile with a build stage that downloads Ubuntu 22.04 base image, installs .NET Framework SDK, and compiles the AirdPro C# application from source. 2. Add Wine and required Windows compatibility libraries to the runtime stage.: "Create a multi-stage Dockerfile with a build stage that downloads Ubuntu 22.04 base image, installs .NET Framework SDK, and compiles the AirdPro C# application from source. 2. Add Wine and required"
- [other] Define separate runtime targets for Windows native containers, Linux-based Wine execution, CLI-only variant, and development mode.: "Define separate runtime targets for Windows native containers, Linux-based Wine execution, CLI-only variant, and development mode."
- [other] Enable BuildKit optimization and configure resource limits in docker-compose.yml for memory (8GB) and CPU (4 cores).: "Enable BuildKit optimization and configure resource limits in docker-compose.yml for memory (8GB) and CPU (4 cores)."
- [other] Test the multi-stage build by invoking build-docker.sh script to verify all target stages compile without error. Validation: confirm all Docker image targets (runtime-windows, runtime-linux, runtime-cli, runtime-dev) build successfully and run configuration test passes.: "Test the multi-stage build by invoking build-docker.sh script to verify all target stages compile without error. Validation: confirm all Docker image targets build successfully and run configuration"
- [readme] AirdPro is a GUI client for conversion from vendor files to Aird files. AirdPro is written in C# and is based on pwiz_bindings_cli.dll from the ProteoWizard project.: "AirdPro is a GUI client for conversion from vendor files to Aird files. AirdPro is written in C# and is based on pwiz_bindings_cli.dll from the ProteoWizard project."
- [readme] By using library from ProteoWizard MSConvert. AirdPro can convert all the vendor format that MSConvert supports to Aird format.: "By using library from ProteoWizard MSConvert. AirdPro can convert all the vendor format that MSConvert supports to Aird format."
1---2name: build-automation-scripting3description: Use when when you have a Windows-only .NET Framework 4.4license: CC-BY-4.05---67# build-automation-scripting89## Summary1011Automate multi-stage Docker builds for cross-platform deployment of Windows-only .NET Framework applications using BuildKit optimization and resource-constrained orchestration. This skill enables reproducible, CI/CD-ready containerization of GUI and CLI variants with Wine runtime integration for non-Windows host execution.1213## When to use1415When you have a Windows-only .NET Framework 4.8 application (GUI or CLI) that must run on macOS or Linux hosts, and you need a reproducible, version-controlled build pipeline that generates separate runtime targets (native Windows, Linux+Wine, CLI-only, development) without manual compilation steps on each target OS.1617## When NOT to use1819- Input application is already compiled to x86_64 Linux binaries or native .NET Core — use containerization without Wine or multi-stage builds.20- Target deployment is Windows-only — native Windows binary or simpler Docker image for Windows containers is more efficient.21- Build resource constraints on the CI/CD host are < 2GB memory or single-core — the 8GB/4-core requirement will cause OOM or timeout failures.2223## Inputs2425- .NET Framework 4.8 C# source code26- Dockerfile with multi-stage configuration27- docker-compose.yml with resource limits and service definitions28- build-docker.sh automation script29- ProteoWizard dependencies (pwiz_bindings_cli.dll)30- Wine configuration templates (if pre-built)3132## Outputs3334- Docker image (runtime-windows target)35- Docker image (runtime-linux target with Wine integration)36- Docker image (runtime-cli target, headless)37- Docker image (runtime-dev target, debug-enabled)38- docker-compose environment file39- Build validation log confirming all stages compiled without error4041## How to apply4243Create a multi-stage Dockerfile that decouples the build stage (Ubuntu 22.04 base, .NET Framework SDK, C# compilation from source) from runtime stages (Wine+Windows compatibility libraries, .NET Framework 4.8 runtime, GUI/CLI environment configuration). Enable DOCKER_BUILDKIT=1 for optimization and define resource limits (8GB memory, 4 cores CPU) in docker-compose.yml. Configure Wine prefix initialization and separate build targets using Docker build stages: runtime-windows (native Windows execution), runtime-linux (Wine-based Linux execution), runtime-cli (headless CLI variant), and runtime-dev (development mode with debug symbols). Execute the build-docker.sh script to compile all targets. Validate that each Docker image target builds without error and the configuration test passes (typically via health check validation or container startup verification).4445## Related tools4647- **Docker Desktop for Mac** (Container runtime and build orchestration environment for multi-stage builds on macOS) — https://www.docker.com/products/docker-desktop48- **Docker Engine** (Container runtime for building and executing multi-stage Docker images on Linux hosts) — https://docs.docker.com/engine/49- **Wine** (Windows compatibility layer providing runtime environment for .NET Framework 4.8 and Windows GUI in Linux containers) — https://www.winehq.org/50- **.NET Framework 4.8** (Target runtime library compiled into Docker image runtime stage for executing AirdPro C# GUI and CLI binaries)51- **ProteoWizard** (Dependency library (pwiz_bindings_cli.dll) providing vendor format file I/O for AirdPro conversion logic) — https://github.com/CSi-Studio/AirdPro52- **XQuartz** (X11 server for forwarding GUI display from Wine-based containers to macOS host)5354## Examples5556```57export DOCKER_BUILDKIT=1; ./build-docker.sh; docker run --rm -v airdpro-data:/data airdpro:runtime-linux config-test58```5960## Evaluation signals6162- All four Docker image targets (runtime-windows, runtime-linux, runtime-cli, runtime-dev) build successfully with no compilation errors in the build-docker.sh output log.63- Configuration test passes: `docker run --rm <image> config-test` or equivalent health check returns exit code 0.64- Docker image size for runtime-linux target is < 2GB (Wine + .NET Framework overhead is typical; significant deviation indicates bloat or missing layer optimization).65- Container starts without 'OutOfMemory' or resource allocation failures when docker-compose.yml memory limit (8GB) and CPU limit (4 cores) are applied via `docker inspect` or `docker stats`.66- GUI variant runs without Wine or X11 socket errors when invoked with `xhost +local:docker` and DISPLAY forwarding enabled; CLI variant executes without X11 dependency.6768## Limitations6970- Multi-stage builds increase total build time (first build may take 20+ minutes) due to .NET Framework SDK download, compilation, and Wine environment setup in container.71- Wine runtime introduces a ~5–10% performance overhead compared to native Windows execution; CPU-intensive conversions may be slower than native .NET Framework 4.8 on Windows.72- GUI rendering via Wine + X11 forwarding to macOS (via XQuartz) may encounter display glitches or color space mismatches; headless CLI variant is more reliable for batch processing.73- ProteoWizard vendor format support depends on pwiz_bindings_cli.dll version and Wine's ability to load Windows DLLs; format support matrix does not expand beyond what ProteoWizard upstream supports.74- BuildKit optimization requires DOCKER_BUILDKIT=1 environment variable; older Docker versions or CI/CD systems may not support this feature, requiring fallback to classic build mode.7576## Evidence7778- [other] AirdPro is a C# GUI client written for .NET Framework 4.8 that requires a multi-stage Docker build configuration pairing application compilation with Wine runtime to run Windows applications in Linux containers.: "AirdPro is a C# GUI client written for .NET Framework 4.8 that requires a multi-stage Docker build configuration pairing application compilation with Wine runtime to run Windows applications in Linux"79- [other] 1. Create a multi-stage Dockerfile with a build stage that downloads Ubuntu 22.04 base image, installs .NET Framework SDK, and compiles the AirdPro C# application from source. 2. Add Wine and required Windows compatibility libraries to the runtime stage.: "Create a multi-stage Dockerfile with a build stage that downloads Ubuntu 22.04 base image, installs .NET Framework SDK, and compiles the AirdPro C# application from source. 2. Add Wine and required"80- [other] Define separate runtime targets for Windows native containers, Linux-based Wine execution, CLI-only variant, and development mode.: "Define separate runtime targets for Windows native containers, Linux-based Wine execution, CLI-only variant, and development mode."81- [other] Enable BuildKit optimization and configure resource limits in docker-compose.yml for memory (8GB) and CPU (4 cores).: "Enable BuildKit optimization and configure resource limits in docker-compose.yml for memory (8GB) and CPU (4 cores)."82- [other] Test the multi-stage build by invoking build-docker.sh script to verify all target stages compile without error. Validation: confirm all Docker image targets (runtime-windows, runtime-linux, runtime-cli, runtime-dev) build successfully and run configuration test passes.: "Test the multi-stage build by invoking build-docker.sh script to verify all target stages compile without error. Validation: confirm all Docker image targets build successfully and run configuration"83- [readme] AirdPro is a GUI client for conversion from vendor files to Aird files. AirdPro is written in C# and is based on pwiz_bindings_cli.dll from the ProteoWizard project.: "AirdPro is a GUI client for conversion from vendor files to Aird files. AirdPro is written in C# and is based on pwiz_bindings_cli.dll from the ProteoWizard project."84- [readme] By using library from ProteoWizard MSConvert. AirdPro can convert all the vendor format that MSConvert supports to Aird format.: "By using library from ProteoWizard MSConvert. AirdPro can convert all the vendor format that MSConvert supports to Aird format."