This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-mcp.git
The following commit(s) were added to refs/heads/main by this push:
new b6856b2 fix: build and push multi-platform Docker images (#36)
b6856b2 is described below
commit b6856b2fb4d7f65743384fe3906283602ddfdf8d
Author: Fine0830 <[email protected]>
AuthorDate: Wed Mar 18 11:03:37 2026 +0800
fix: build and push multi-platform Docker images (#36)
---
.github/workflows/publish-docker.yaml | 22 +++++++++---------
Dockerfile | 14 ++++++++----
Makefile | 25 +++++++++++++++-----
README.md | 20 +++++++++++++++-
RELEASE.md | 43 +++++++++++------------------------
scripts/push-release.sh | 1 +
6 files changed, 72 insertions(+), 53 deletions(-)
diff --git a/.github/workflows/publish-docker.yaml
b/.github/workflows/publish-docker.yaml
index 1e8e0fd..bbf1e0c 100644
--- a/.github/workflows/publish-docker.yaml
+++ b/.github/workflows/publish-docker.yaml
@@ -37,21 +37,21 @@ jobs:
packages: write
timeout-minutes: 30
env:
- VERSION: ${{ github.event_name == 'release' &&
github.event.release.tag_name || github.sha }}
PLATFORMS: linux/amd64,linux/arm64
- HUB: ${{ github.event_name == 'release' && 'docker.io/apache' ||
'ghcr.io/apache' }}
+ IMAGE: ${{ github.event_name == 'release' &&
'docker.io/apache/skywalking-mcp' || 'ghcr.io/apache/skywalking-mcp' }}
steps:
- uses: actions/checkout@v4
- - name: Set up Go
- uses: actions/setup-go@v5
- with:
- go-version: 1.25
- - name: Build binary
- run: make build
- - name: Build docker image
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ - name: Resolve image version
run: |
- make docker-build
- docker image ls
+ if [ "${{ github.event_name }}" = "release" ]; then
+ VERSION="${GITHUB_REF_NAME#v}"
+ else
+ VERSION="${GITHUB_SHA}"
+ fi
+ echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
+ echo "Resolved VERSION=${VERSION}"
- name: Log in to GHCR
uses: docker/login-action@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
diff --git a/Dockerfile b/Dockerfile
index 80eedcc..2ff2a34 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,10 +14,14 @@
# limitations under the License.
# Build stage
-FROM golang:1.25-bookworm AS builder
+FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS builder
# Default version
ARG VERSION="dev"
+ARG GIT_COMMIT="unknown"
+ARG BUILD_DATE="unknown"
+ARG TARGETOS
+ARG TARGETARCH
# Set the working directory
WORKDIR /app
@@ -25,15 +29,15 @@ WORKDIR /app
# Copy go.mod and go.sum files
COPY go.mod go.sum ./
-# Go get dependencies
-RUN go mod tidy
+# Resolve dependencies
+RUN go mod download
# Copy the source code
COPY . .
# Build the application
-RUN CGO_ENABLED=0 go build \
- -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse
HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
+RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
+ -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X
main.date=${BUILD_DATE}" \
-o bin/swmcp ./cmd/skywalking-mcp/main.go
# Make a stage to run the app
diff --git a/Makefile b/Makefile
index 1e5263d..982d91a 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,11 @@ LICENSE_EYE = license-eye
HUB ?= ghcr.io/apache
APP_NAME = skywalking-mcp
+IMAGE ?= $(HUB)/$(APP_NAME)
+PLATFORMS ?= linux/amd64
+MULTI_PLATFORMS ?= linux/amd64,linux/arm64
+OUTPUT ?= --load
+IMAGE_TAGS ?= -t $(IMAGE):$(VERSION) -t $(IMAGE):latest
.PHONY: all
all: build ;
@@ -94,13 +99,21 @@ clean:
build-image: docker-build ## Build the Docker image.
.PHONY: docker-build
-docker-build: ## Build the Docker image (local only).
- docker build --build-arg VERSION=$(VERSION) . -t
$(HUB)/$(APP_NAME):$(VERSION) -t $(HUB)/$(APP_NAME):latest
+docker-build: ## Build the Docker image with Buildx. Defaults to a local
linux/amd64 image; override PLATFORMS/OUTPUT as needed.
+ docker buildx build --platform $(PLATFORMS) \
+ --build-arg VERSION=$(VERSION) \
+ --build-arg GIT_COMMIT=$(GIT_COMMIT) \
+ --build-arg BUILD_DATE=$(BUILD_DATE) \
+ $(IMAGE_TAGS) \
+ $(OUTPUT) .
.PHONY: docker-push
-docker-push: ## Push existing Docker images to the registry.
- docker push $(HUB)/$(APP_NAME):$(VERSION)
- docker push $(HUB)/$(APP_NAME):latest
+docker-push: ## Build and push multi-platform Docker images to the registry.
+ $(MAKE) docker-build PLATFORMS=$(MULTI_PLATFORMS) OUTPUT=--push
+
+.PHONY: docker-build-multi
+docker-build-multi: ## Build a local multi-platform image index without
pushing (requires OUTPUT like --output=type=oci,dest=...).
+ $(MAKE) docker-build PLATFORMS=$(MULTI_PLATFORMS) OUTPUT='$(OUTPUT)'
.PHONY: docker
docker: docker-build
@@ -129,4 +142,4 @@ release-push-candidate:
.PHONY: lint fix-lint
.PHONY: license-header fix-license-header dependency-license
fix-dependency-license
.PHONY: release-binary release-source release-sign release-assembly
-.PHONY: release-push-candidate
+.PHONY: release-push-candidate docker-build-multi
diff --git a/README.md b/README.md
index 5d9e8f5..a269b79 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,25 @@ bin/swmcp sse --sse-address localhost:8000 --base-path /mcp
--sw-url http://loca
If using Docker:
-`make build-image` to build the Docker image, then configure the MCP server
like this:
+`make build-image` builds a local `linux/amd64` image by default. For
multi-platform publishing, use `make docker-push`, which builds and pushes
`linux/amd64,linux/arm64` images via Docker Buildx.
+
+Common variants:
+
+```bash
+# Build a local image and load it into your Docker daemon
+make build-image
+
+# Build and push a multi-platform image to the default registry
+make docker-push VERSION=0.1.0
+
+# Push to a custom registry/repository
+make docker-push IMAGE=ghcr.io/your-org/skywalking-mcp VERSION=0.1.0
+
+# Build for a custom platform set
+make docker-build PLATFORMS=linux/arm64 OUTPUT=--load
+```
+
+Then configure the MCP server like this:
```json
{
diff --git a/RELEASE.md b/RELEASE.md
index 525ce25..106aa29 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -130,42 +130,25 @@ Send an announcement email to `[email protected]` and
`[email protected]
```
Subject: [ANNOUNCE] Apache SkyWalking MCP {VERSION} Released
-Hi the SkyWalking Community:
+Hi All,
-This is a call for vote to release Apache SkyWalking MCP version $VERSION.
+The Apache SkyWalking Team is glad to announce the release of Apache
SkyWalking MCP {VERSION}.
-Release notes:
+SkyWalking: APM (application performance monitor) tool for distributed
systems, especially designed for microservices, cloud native and
container-based (Docker, Kubernetes, Mesos) architectures.
- * https://github.com/apache/skywalking-mcp/blob/v$VERSION/CHANGES.md
+SkyWalking MCP: an MCP (Model Context Protocol) server that bridges AI agents
with Apache SkyWalking OAP via GraphQL. It exposes SkyWalking's observability
data (traces, logs, metrics, topology, alarms, events) as MCP tools, prompts,
and resources.
-Release Candidate:
+Please refer to the change log for the complete list of changes:
https://github.com/apache/skywalking-mcp/releases/tag/v{VERSION}
- * https://dist.apache.org/repos/dist/dev/skywalking/mcp/$VERSION
- * sha512 checksums
- - $(cat ${PRODUCT_NAME}.tgz.sha512)
+Apache SkyWalking website: http://skywalking.apache.org/
-Release Tag :
+Downloads: http://skywalking.apache.org/downloads/
- * (Git Tag) $TAG_NAME
+Twitter: https://twitter.com/ASFSkyWalking
-Release Commit Hash :
+SkyWalking Resources:
+- GitHub: https://github.com/apache/skywalking
+- Issue: https://github.com/apache/skywalking/issues
+- Mailing list: [email protected] <mailto:[email protected]>
- * https://github.com/apache/skywalking-mcp/tree/${RELEASE_COMMIT}
-
-Keys to verify the Release Candidate :
-
- * https://dist.apache.org/repos/dist/release/skywalking/KEYS
-
-Guide to build the release from source :
-
- * https://github.com/apache/skywalking-mcp/blob/v$VERSION/README.md
-
-Voting will start now and will remain open for at least 72 hours, all PMC
members are required to give their votes.
-
-[ ] +1 Release this package.
-[ ] +0 No opinion.
-[ ] -1 Do not release this package because....
-
-Thanks.
-
-[1]
https://github.com/apache/skywalking/blob/master/docs/en/guides/How-to-release.md#vote-check
+- The Apache SkyWalking Team
diff --git a/scripts/push-release.sh b/scripts/push-release.sh
index 7a00c71..0e1ccef 100755
--- a/scripts/push-release.sh
+++ b/scripts/push-release.sh
@@ -77,6 +77,7 @@ Release Candidate:
* https://dist.apache.org/repos/dist/dev/skywalking/mcp/$VERSION
* sha512 checksums
- $(cat ${PRODUCT_NAME}.tgz.sha512)
+ - $(cat ${PRODUCT_NAME}-src.tgz.sha512)
Release Tag :