generator icon indicating copy to clipboard operation
generator copied to clipboard

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

Open zemecom opened this issue 10 months ago • 0 comments

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 .

zemecom avatar Feb 04 '26 11:02 zemecom