Skip to content

Fix Docker build: missing sockets extension and Composer GitHub auth failure #321

@zemecom

Description

@zemecom

Description

The Docker build process fails during composer install due to two distinct issues regarding environment requirements and repository access.

1. Missing sockets extension

The buggregator/trap dependency (required in require-dev) needs the ext-sockets PHP extension, which is not installed in the base builder image.
Error Log:

Problem 1
  - Root composer.json requires buggregator/trap ^1.13 -> satisfiable by buggregator/trap[1.13.0, ..., 1.15.1].
  - buggregator/trap[1.13.0, ..., 1.15.1] require ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.

2. Composer GitHub API Authentication

When installing dependencies, Composer attempts to use the GitHub API for the mcp-schema repository because it is defined with "type": "github". This fails inside the Docker container (likely due to rate limits or missing tokens), resulting in an authentication error.
Error Log:

In AuthHelper.php line 132:
  Could not authenticate against github.com

Proposed Solution

  1. Dockerfile: Add RUN docker-php-ext-install sockets before running composer install.
  2. composer.json: Change the repository type for mcp-schema from github to git. This forces Composer to clone the repository using git (HTTPS) instead of using the GitHub API, bypassing the authentication requirement for public repos.

Steps to Reproduce

Run the build command:

docker build -t context-generator .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions