Epic: Windows support
Problem
This is a meta-issue for keeping track of all the things we're doing around Windows support for Compose. Various things that are part of this: - Building a binary on Windows. PyInstaller, the method we currently use to build binaries for Linux and OS X, also works with Windows. In theory this should just work. It would be useful to have build scripts etc to automate this. - Run Compose inside a container. This may be be easier than building a native binary for Windows. https://github.com/docker/compose/issues/169 https://github.com/docker/compose/pull/1806 - Making Compose Windows compatible. I expect this will be mostly making sure paths work and getting the TTYs to work. - Volume sharing. When running Compose on OS X, it expects `/Users` to be mounted in the right place so volumes work. I wonder if we need something added to Machine/boot2docker to make volumes work as expected on Windows. (The Compose quick start guide has a demonstration of how volumes are used to mount code inside a container.) - Run CI tests on Windows. We don't all test on Windows, so we'd have to be careful about regressions. https://github.com/docker/compose/issues/886 Steps: - [x] Investigate whether binaries will build cleanly on Windows https://github.com/docker/compose/issues/1051 - [x] Investigate whether running Compose inside a container will be easier than running it natively on Windows Related issues: - https://github.com/docker/compose/issues/598
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Enhance Windows Support for Docker Compose
Docker Compose currently lacks full compatibility with Windows due to differences in file path handling, TTY support, and volume sharing mechanisms. The existing build process using PyInstaller may not be fully optimized for Windows, and running tests on Windows environments is limited, leading to potential regressions.
Awaiting Verification
Be the first to verify this fix
- 1
Automate Windows Binary Build
Create a build script using PyInstaller to automate the binary creation process for Windows. This script should handle dependencies and ensure the binary is built in a clean environment.
bashpyinstaller --onefile compose.py - 2
Implement Containerized Compose Execution
Modify the Docker Compose setup to allow execution within a container on Windows. This will help bypass native compatibility issues and simplify the user experience.
bashdocker run --rm -v ${PWD}:/app docker/compose:latest up - 3
Ensure Path and TTY Compatibility
Review and update the codebase to handle Windows-style paths and ensure TTY support works as expected. This may involve using libraries that abstract path handling.
pythonimport os path = os.path.join('C:\', 'Users', 'example') - 4
Enhance Volume Sharing for Windows
Investigate and modify the Machine/boot2docker configuration to ensure that the '/Users' directory is correctly mounted, allowing proper volume sharing in Windows environments.
bashdocker-machine ssh default 'sudo mount -t vboxsf -o uid=1000,gid=1000 Users /Users' - 5
Establish CI Testing for Windows
Set up continuous integration tests specifically for Windows to catch regressions early. This should include running the full test suite in a Windows environment.
bashci-test-windows.sh
Validation
Confirm that the Windows binary builds successfully and runs without errors. Test the containerized execution of Compose and verify that paths and TTYs function correctly. Ensure that volume sharing works as expected and that CI tests pass on Windows.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep