-
-
Notifications
You must be signed in to change notification settings - Fork 261
Description
Description
Windows developers encounter a critical failure when attempting to run VulnerableCode using Docker Compose. The main vulnerablecode service fails to start with the following error:
env: use -[v]S to pass options in shebang line
This prevents Windows developers from setting up a local development environment and running essential commands like:
docker compose exec vulnerablecode ./manage.py import <importer>
docker compose exec vulnerablecode ./manage.py improve --allRoot Cause
The issue occurs because:
- Git on Windows by default converts line endings from LF (Unix) to CRLF (Windows) when cloning repositories
- The repository lacks a
.gitattributesfile to enforce consistent line endings - When Docker runs the Linux container, the shebang line (
#!/usr/bin/env python) inmanage.pyfails because it includes the Windows carriage return (\r) character - This causes the container to exit immediately with code 1
Steps to Reproduce
Environment:
- OS: Windows 10/11
- Docker Desktop for Windows (with WSL2 backend)
- Git for Windows (default settings)
Steps:
- Clone the repository on Windows:
git clone https://github.com/aboutcode-org/vulnerablecode.git - Navigate to the directory:
cd vulnerablecode - Run:
docker compose up -d - Check service status:
docker compose ps - Observe that the
vulnerablecodeservice has exited - Check logs:
docker compose logs vulnerablecode
Expected behavior: All services should start successfully and remain running.
Actual behavior: The vulnerablecode service exits with error "env: use -[v]S to pass options in shebang line"
Impact
This issue affects:
- New contributors trying to set up their development environment on Windows
- Windows developers participating in GSoC or other contribution programs
- Anyone attempting to test or deploy VulnerableCode on Windows with Docker
Additional Notes
This is a common issue in cross-platform development and is considered a best practice to include a .gitattributes file in repositories that are used across different operating systems.
I would like to contribute
I'd be happy to submit a PR to add the .gitattributes file and update the documentation if needed. Please let me know if this approach looks good to you.