Skip to content

feat: Add multi-stage Docker build and GHCR publishing workflow#257

Open
malladinagarjuna2 wants to merge 1 commit intomodelcontextprotocol:mainfrom
malladinagarjuna2:docker
Open

feat: Add multi-stage Docker build and GHCR publishing workflow#257
malladinagarjuna2 wants to merge 1 commit intomodelcontextprotocol:mainfrom
malladinagarjuna2:docker

Conversation

@malladinagarjuna2
Copy link
Copy Markdown

Description

This PR addresses the need for an official Docker image for the MCP Conformance Server. Following discussions in the community and referencing Kuadrant/mcp-gateway issue #411, this migration moves the Docker build logic "upstream" to this repository.

The implementation follows the pattern established in the modelcontextprotocol/inspector repository to ensure consistency across the MCP ecosystem.

Key Changes

  • New Dockerfile: Added a multi-stage Dockerfile at the repository root.
    • Stage 1 (Builder): Handles dependency installation (npm ci) and TypeScript compilation (npm run build) for the server located in examples/servers/typescript/.
    • Stage 2 (Release): Produces a slim, production-ready image using node:24-alpine.
  • CI/CD Integration: Updated .github/workflows/ci.yml to include a publish-docker job.
    • Automatically builds and pushes images to GHCR (ghcr.io) upon official releases.
    • Supports multi-architecture builds (linux/amd64 and linux/arm64) using Docker Buildx and QEMU.
    • Includes Artifact Attestation for build provenance and security.

Testing Performed

  1. Local Build: Verified the Dockerfile locally via docker build -t conformance-test . and confirmed the server starts on port 3000.
image
  1. CI Validation: Verified the workflow on a personal fork. The publish-docker job successfully executes the build and metadata extraction steps.
    link : https://github.com/malladinagarjuna2/conformance/actions/runs/24942105590

Related Issues

@david-martin
Copy link
Copy Markdown

fyi @pcarleton (been a while, but this came up in a thread on discord as a nice thing to have https://discord.com/channels/1358869848138059966/1443175063141748828)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants