From f04c995f0a58685a48adcc0eda40e2631ec06b82 Mon Sep 17 00:00:00 2001 From: adam jones Date: Thu, 7 Aug 2025 16:25:35 +0100 Subject: [PATCH] Add Docker image documentation and workflow (#225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a CI action to build docker images and publish them to GHCR on every commit. We can then use these when deploying the registry. This turned out to be an upstream blocker of building the infra for deployment, and something like this is needed for either deployment approach we're exploring. --- ## Summary - Add comprehensive documentation for pre-built Docker images in README - Include usage examples and configuration guidance - Add GitHub Actions workflow for automated Docker image publishing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude --- .github/workflows/docker.yml | 47 ++++++++++++++++++++++++++++++++++++ README.md | 18 ++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..e476860 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,47 @@ +name: Docker Build and Push + +on: + push: + branches: [ main ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,prefix=main-{{date 'YYYYMMDD'}}-,enable={{is_default_branch}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/README.md b/README.md index 50d6426..3bf08ab 100644 --- a/README.md +++ b/README.md @@ -417,6 +417,24 @@ The service can be configured using environment variables: | `MCP_REGISTRY_SEED_IMPORT` | Import `seed.json` on first run | `true` | | `MCP_REGISTRY_SERVER_ADDRESS` | Listen address for the server | `:8080` | +## Pre-built Docker Images + +Pre-built Docker images are automatically published to GitHub Container Registry on each release and main branch commit: + +```bash +# Run latest from main branch +docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:latest + +# Run specific commit build +docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main-20250806-a1b2c3d +``` + +**Available image tags:** +- `latest` - Latest commit from main branch +- `main--` - Specific commit builds + +**Configuration:** The Docker images support all environment variables listed in the [Configuration](#configuration) section. For production deployments, you'll need to configure the database connection and other settings via environment variables. + ## License See the [LICENSE](LICENSE) file for details.