feat: docker-compose support + Docker Hub publish workflow#39
Open
dj4oC wants to merge 3 commits into
Open
Conversation
Adds a docker-compose.yml and .env.example so a contributor can run the MCP server with docker-compose up --build instead of building/running the binary or a bare docker run by hand. The HTTP transport is always used (stdio doesn't fit a detached compose service), bound to 0.0.0.0:8090 so port publishing works, which means OCIS_MCP_HTTP_SECRET is required — same security posture already used in the owncloud/ocis ocis_full deployment example. Signed-off-by: David Walter <david.walter@kiteworks.com>
The Quick Setup and Docker sections used OCIS_URL / OCIS_ACCESS_TOKEN, which internal/config/config.go has never read -- the real names are OCIS_MCP_OCIS_URL and OCIS_MCP_APP_TOKEN_USER / OCIS_MCP_APP_TOKEN_VALUE. Following the old docs literally produced 'OCIS_MCP_OCIS_URL is required' at startup. Fixed both sections while adding the new Docker Compose section introduced in the previous commit. Signed-off-by: David Walter <david.walter@kiteworks.com>
Adds .github/workflows/docker.yml with two jobs: - build: runs on every push and pull_request, no credentials needed. Builds linux/amd64 and smoke-tests the resulting binary (confirms it starts and fails config validation with the expected error), then separately validates linux/amd64+linux/arm64 both build (push: false). - publish: runs on push to main, on v* tags, or manual workflow_dispatch. Logs into Docker Hub (secrets.DOCKERHUB_USERNAME / secrets.DOCKERHUB_TOKEN) and pushes a multi-arch owncloud/ocis-mcp-server image, tagged 'latest' on main and semver tags (vX.Y.Z, X.Y, X) on version tags. This closes the gap flagged in owncloud/ocis#12603: that PR's ocis_full deployment example references owncloud/ocis-mcp-server, which does not exist on any registry yet. The publish job requires DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets to be configured by a maintainer with real Docker Hub credentials before it will succeed -- see the PR description for this exact prerequisite (this commit cannot configure it). Signed-off-by: David Walter <david.walter@kiteworks.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This repo has no
docker-compose.yml(a contributor has to build the binary or run a baredocker runby hand to test changes), and no GitHub Actions workflow publishes theowncloud/ocis-mcp-serverimage anywhere.owncloud/ocisPR#12603 added this image as an optional
service in the
ocis_fulldeployment example, but flagged as a known limitation that theimage doesn't exist on any registry yet — verified via a 404 from Docker Hub.
Solution
docker-compose.yml+.env.examplefor local dev:cp .env.example .env, fill inyour oCIS URL and a secret,
docker-compose up --build. Always uses the HTTP transportbound to
0.0.0.0:8090(required for port publishing), soOCIS_MCP_HTTP_SECRETisrequired — same fail-closed posture as the
owncloud/ocisocis_fullwiring.README.md's "Quick Setup" and "Docker" sections: they usedOCIS_URL/OCIS_ACCESS_TOKEN, whichinternal/config/config.gohas never read (thereal names are
OCIS_MCP_OCIS_URL/OCIS_MCP_APP_TOKEN_USER/OCIS_MCP_APP_TOKEN_VALUE). Following the old docs literally failed at startup. Fixedboth sections and added a new "Docker Compose" section.
.github/workflows/docker.yml:buildjob (every push + PR, no credentials needed): buildslinux/amd64, loads it,and smoke-tests that the binary actually starts and fails config validation with the
expected error; separately validates
linux/amd64+linux/arm64both build(
push: false).publishjob (push tomain,v*tags, or manualworkflow_dispatch): logs intoDocker Hub and pushes a multi-arch image —
latestonmain, semver tags(
vX.Y.Z/X.Y/X) on version tags.Testing
docker-compose config --quiet,docker-compose up --build, and a live curl round-trip(401 unauthenticated, 200 + valid JSON-RPC
initializeresult when authenticated)confirmed locally.
docker build+docker run(linux/amd64 only, this machine has no local buildx for the arm64 leg)..github/workflows/docker.ymlfor this branch did notrun to completion: it finished with conclusion
startup_failure, 0 jobs created, 0sduration, no logs —
https://github.com/owncloud/ocis-mcp-server/actions/runs/29567752175. See "CI Status"
below for the investigation and likely cause.
Known Limitation / Manual Prerequisite
The
publishjob needs repository secretsDOCKERHUB_USERNAMEandDOCKERHUB_TOKEN(aDocker Hub access token, not a password) added under Settings > Secrets and variables >
Actions, using an account with push access to the
owncloudDocker Hub org/namespace.This PR cannot configure that — a maintainer needs to add both secrets. Once the workflow
is allowed to run at all (see "CI Status" below), the
buildjob will pass on every PRwhile
publishwill fail at the login step onmain/tag pushes until these secrets exist.Once the secrets are added, either push to
mainor av*tag, ortrigger
workflow_dispatchmanually, to get the first real Docker Hub image published —that also unblocks
owncloud/ocis#12603.CI Status: docker.yml Workflow Currently Fails to Start
The new
.github/workflows/docker.ymlworkflow does not run at all on this branch. Theactual run — https://github.com/owncloud/ocis-mcp-server/actions/runs/29567752175 —
completed with conclusion
startup_failure, 0 jobs created, 0s duration, and no logs ofany kind. This is a more fundamental blocker than the Docker Hub secrets prerequisite
noted above: until it's resolved, neither
build(which needs no secrets) norpublishcan run at all.
This was investigated and is not a workflow-authoring bug or a transient blip:
actionlint— no syntax or schemaerrors.
ci.ymlworkflow ran successfully on theidentical commit.
403from thissession — there's no org-admin visibility available here to inspect or change the
setting directly.
Most likely explanation: a
startup_failurewith zero jobs created is the known signatureof an organization-level GitHub Actions allow-list rejecting a workflow before any job is
even scheduled. If the
owncloudorg's Actions settings are configured to Settings >Actions > General > "Allow select actions and reusable workflows", and the
docker/*actions this workflow uses (
docker/setup-qemu-action,docker/setup-buildx-action,docker/login-action,docker/metadata-action,docker/build-push-action) aren't on thatallow-list, GitHub blocks the entire run at dispatch time — before any job or log is
produced, which matches exactly what was observed.
This requires an
owncloudorg admin to check and, if applicable, adddocker/*(or thefive specific actions above) to the allow-list. It cannot be checked or fixed from this
session. Until resolved, this workflow cannot be verified to run at all, independent of the
Docker Hub secrets issue above.
Risk
Low. Purely additive (new files, one doc bug fix); no existing runtime code changed.
🤖 Generated with Claude Code