Skip to content

Add execution strategy pattern to support Docker, Wine, WSL, and Windows Sandbox#279

Closed
Copilot wants to merge 1 commit intomasterfrom
copilot/generalize-executors-for-envs
Closed

Add execution strategy pattern to support Docker, Wine, WSL, and Windows Sandbox#279
Copilot wants to merge 1 commit intomasterfrom
copilot/generalize-executors-for-envs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

Executors currently execute directly on the host OS. This adds support for running implementations in containerized/virtualized environments (Docker, Wine, WSL, Windows Sandbox) with proper path mapping and binding translation.

Changes

  • New interfaces

    • IExecutionStrategy: Strategy for executing in specific environments
    • IExecutionContext: Abstracts process execution context
    • IPathMapper: Translates paths between host and target environments
  • Strategy implementations

    • NativeProcessStrategy: Existing behavior (default)
    • DockerStrategy: Mounts implementations as volumes, maps to /0install/* paths
    • WineStrategy: Maps Linux paths to Wine Z:\ drive, handles WINEPREFIX
    • WSLStrategy: Converts Windows paths to /mnt/*, invokes via wsl.exe
    • WindowsSandboxStrategy: Generates .wsb config, uses SHA256 for deterministic path mapping
  • Integration

    • Executor accepts optional IExecutionStrategy parameter
    • Each strategy handles EnvironmentBinding, ExecutableInVar, ExecutableInPath with appropriate path translation

Usage

// Backward compatible - defaults to native execution
var executor = new Executor(implementationStore);

// Execute in Docker container
var executor = new Executor(implementationStore, 
    new DockerStrategy("ubuntu:latest"));

// Execute via WSL
var executor = new Executor(implementationStore, 
    new WSLStrategy("Ubuntu"));

executor.Start(selections);

All bindings are translated to target environment paths automatically. Custom strategies can be implemented via IExecutionStrategy.

Original prompt

This section details on the original issue you should resolve

<issue_title>Generalize ZeroInstall.Services.Executors to support Docker, Wine, WSL and Windows Sandbox</issue_title>
<issue_description>Currently, the services in ZeroInstall.Services.Executors only support launching applications directly on the OS 0install is running on.

We should generalize this, so that it can also orchestrate executing applications inside environments like:

  • Docker containers (running Linux binaries on Windows and Linux)
  • Wine (running Windows binaries on Linux)
  • WSL (running Linux binaries on Windows)
  • Windows Sandbox (running Windows binaries on Windows)

For each of these cases it will be necessary to:

  • map cached implementation directories into the target system
  • handle bindings
    • for EnvironmentBindings, paths need to be translated and env vars need to be applied inside the target system
    • for ExecutableInVars and ExecutableInPaths, stub executables need to be generated for the target OS and mapped in</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Generalize ZeroInstall.Services.Executors to support multiple environments Add execution strategy pattern to support Docker, Wine, WSL, and Windows Sandbox Feb 6, 2026
Copilot AI requested a review from bastianeicher February 6, 2026 18:27
…e, WSL, and Windows Sandbox

Co-authored-by: bastianeicher <414366+bastianeicher@users.noreply.github.com>
@bastianeicher bastianeicher force-pushed the copilot/generalize-executors-for-envs branch from b8fca71 to 17fb69c Compare February 11, 2026 14:34
@bastianeicher bastianeicher deleted the copilot/generalize-executors-for-envs branch April 3, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generalize ZeroInstall.Services.Executors to support Docker, Wine, WSL and Windows Sandbox

2 participants