Skip to content

Dockerfile and setup.sh fail for examples without requirements.txt and on Windows environments #143

@VIDYANKSHINI

Description

@VIDYANKSHINI

Dockerfile and setup.sh fail for certain examples and on Windows environments

Hi team! While exploring the repository, I found two bugs related to how examples are built and set up.

1. Dockerfile fails to build for examples without a requirements.txt

The root Dockerfile unconditionally tries to copy the requirements file on line 12:

COPY ${EXAMPLE}/requirements.txt ./requirements.txt

However, several example directories (like web3, mcp-agents, and gemini-quickstart) do not have a requirements.txt file at their root level. If a user tries to build the Docker image for these examples, the build will immediately crash with a file not found error.

Suggested Fix

Update the Dockerfile to conditionally copy and install requirements.txt only if it exists, or ensure every example directory contains one.


2. setup.sh fails on Windows (Git Bash)

In setup.sh on line 90, the virtual environment is activated using a hardcoded path:

source .venv/bin/activate

If a Windows user runs this script using Git Bash or MSYS2, Python creates a Scripts directory instead of bin. This causes the script to fail with a No such file or directory error.

Suggested Fix

Check for both paths before sourcing:

if [[ -f ".venv/bin/activate" ]]; then
    source .venv/bin/activate
elif [[ -f ".venv/Scripts/activate" ]]; then
    source .venv/Scripts/activate
fi

Let me know if you'd like me to submit a Pull Request to address these issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions