From c697d7a0c400f8233dfb846e7c6f9f3804e3ec8f Mon Sep 17 00:00:00 2001 From: Daniel Drack Date: Wed, 1 Apr 2026 08:23:32 +0200 Subject: [PATCH] feat: add multi-arch support - .github/workflows/ci.yml: add QEMU setup for multi-arch builds, update Docker platforms - Dockerfile: use platform-specific build, add target OS and architecture args - README.md: align table formatting for better readability --- .github/workflows/ci.yml | 4 ++++ Dockerfile | 9 ++++++--- README.md | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 598e236..bfad3c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,14 @@ jobs: type=sha,prefix=sha- type=raw,value=latest,enable={{is_default_branch}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index a4ebc9f..c334084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ # Build stage -FROM golang:1.25-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS builder + +ARG TARGETOS=linux +ARG TARGETARCH=amd64 WORKDIR /build @@ -13,8 +16,8 @@ RUN go mod download # Copy source code COPY . . -# Build the binary -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o skillserver ./cmd/skillserver +# Build the binary for the target platform +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -installsuffix cgo -o skillserver ./cmd/skillserver # Runtime stage FROM alpine:latest diff --git a/README.md b/README.md index 645e3c2..e57bf6a 100644 --- a/README.md +++ b/README.md @@ -37,20 +37,20 @@ SkillServer supports both **environment variables** and **command-line flags**. ### Environment Variables -| Variable | Alternative | Default | Description | -|----------|-------------|---------|-------------| -| `SKILLSERVER_DIR` | `SKILLS_DIR` | `./skills` | Directory to store skills | -| `SKILLSERVER_PORT` | `PORT` | `8080` | Port for the web server | -| `SKILLSERVER_GIT_REPOS` | `GIT_REPOS` | (empty) | Comma-separated Git repository URLs | -| `SKILLSERVER_ENABLE_LOGGING` | (none) | `false` | Enable logging to stderr (default: false to avoid interfering with MCP stdio) | +| Variable | Alternative | Default | Description | +|------------------------------|--------------|------------|-------------------------------------------------------------------------------| +| `SKILLSERVER_DIR` | `SKILLS_DIR` | `./skills` | Directory to store skills | +| `SKILLSERVER_PORT` | `PORT` | `8080` | Port for the web server | +| `SKILLSERVER_GIT_REPOS` | `GIT_REPOS` | (empty) | Comma-separated Git repository URLs | +| `SKILLSERVER_ENABLE_LOGGING` | (none) | `false` | Enable logging to stderr (default: false to avoid interfering with MCP stdio) | ### Command-Line Flags -| Flag | Description | -|------|-------------| -| `--dir` | Directory to store skills (overrides `SKILLSERVER_DIR` or `SKILLS_DIR`) | -| `--port` | Port for the web server (overrides `SKILLSERVER_PORT` or `PORT`) | -| `--git-repos` | Comma-separated list of Git repository URLs (overrides `SKILLSERVER_GIT_REPOS` or `GIT_REPOS`) | +| Flag | Description | +|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------| +| `--dir` | Directory to store skills (overrides `SKILLSERVER_DIR` or `SKILLS_DIR`) | +| `--port` | Port for the web server (overrides `SKILLSERVER_PORT` or `PORT`) | +| `--git-repos` | Comma-separated list of Git repository URLs (overrides `SKILLSERVER_GIT_REPOS` or `GIT_REPOS`) | | `--enable-logging` | Enable logging to stderr (overrides `SKILLSERVER_ENABLE_LOGGING`). Default: false (disabled to avoid interfering with MCP stdio protocol) | ## Usage