Compare commits
5 Commits
fix/inject
...
9c5d0d1861
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c5d0d1861 | |||
|
|
c16d7964c9 | ||
| 7716e424f9 | |||
|
|
f097c0f4d5 | ||
| c79bdab51b |
43
deploy/Dockerfile.gitea-mcp
Normal file
43
deploy/Dockerfile.gitea-mcp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# gitea-mcp-server, rebuilt on a shell-bearing base.
|
||||||
|
#
|
||||||
|
# WHY THIS EXISTS
|
||||||
|
# ---------------
|
||||||
|
# Upstream `docker.gitea.com/gitea-mcp-server` is distroless: `Cmd` is
|
||||||
|
# ["/app/gitea-mcp"] and there is no /bin/sh at any path (verified by exec'ing
|
||||||
|
# every candidate against the running pod).
|
||||||
|
#
|
||||||
|
# That is fine until the server needs `secretDelivery: injector`. The OpenBao
|
||||||
|
# agent renders secrets to a FILE, so mcpd wraps the container command as
|
||||||
|
# `sh -c '. /vault/secrets/<name>; exec "$0" "$@"'` — which needs a shell. With
|
||||||
|
# no shell the pod cannot source its own credentials, and gitea was the single
|
||||||
|
# server in the fleet blocked on this.
|
||||||
|
#
|
||||||
|
# Copying one static Go binary onto debian:stable-slim is cheaper than building
|
||||||
|
# and maintaining a static "envexec" shim, and follows the precedent already set
|
||||||
|
# by deploy/Dockerfile.docmost-mcp — this repo already rebuilds third-party MCP
|
||||||
|
# servers when it needs to change how they run.
|
||||||
|
#
|
||||||
|
# ca-certificates is required, not incidental: the binary talks HTTPS to
|
||||||
|
# https://mysources.co.uk and a distroless base ships its own trust store which
|
||||||
|
# we are leaving behind.
|
||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ca-certificates \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Pinned by DIGEST, not :latest. `latest` moves, and a rebuild that silently
|
||||||
|
# ships a different server version is indistinguishable from a broken rebuild —
|
||||||
|
# chased exactly that here when a probe started failing after a rebuild.
|
||||||
|
# This digest is gitea-mcp-server 1.6.0 (label org.opencontainers.image.version),
|
||||||
|
# the build that was running when this image was introduced.
|
||||||
|
# To bump: skopeo inspect docker://docker.gitea.com/gitea-mcp-server:latest
|
||||||
|
COPY --from=docker.gitea.com/gitea-mcp-server@sha256:dda8d56e6a91fa89cad186becc27c7aa83d74acdd5dc69f89af840d7bb78a631 /app/gitea-mcp /usr/local/bin/gitea-mcp
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# CMD, not ENTRYPOINT — matching upstream, which sets Cmd ["/app/gitea-mcp"] and
|
||||||
|
# no entrypoint. mcpd maps a server's `command` to k8s `args`, which REPLACES
|
||||||
|
# Cmd but only appends to an ENTRYPOINT; keeping the same form means the plain
|
||||||
|
# (non-injected) path behaves byte-identically to upstream.
|
||||||
|
CMD ["/usr/local/bin/gitea-mcp"]
|
||||||
36
scripts/build-gitea-mcp.sh
Executable file
36
scripts/build-gitea-mcp.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Build gitea-mcp Docker image and push to Gitea container registry
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
|
|
||||||
|
# Load .env for GITEA_TOKEN
|
||||||
|
if [ -f .env ]; then
|
||||||
|
set -a; source .env; set +a
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Push directly to internal address (external proxy has body size limit)
|
||||||
|
REGISTRY="10.0.0.194:3012"
|
||||||
|
IMAGE="gitea-mcp"
|
||||||
|
TAG="${1:-latest}"
|
||||||
|
|
||||||
|
echo "==> Building gitea-mcp image..."
|
||||||
|
podman build -t "$IMAGE:$TAG" -f deploy/Dockerfile.gitea-mcp .
|
||||||
|
|
||||||
|
echo "==> Tagging as $REGISTRY/michal/$IMAGE:$TAG..."
|
||||||
|
podman tag "$IMAGE:$TAG" "$REGISTRY/michal/$IMAGE:$TAG"
|
||||||
|
|
||||||
|
echo "==> Logging in to $REGISTRY..."
|
||||||
|
podman login --tls-verify=false -u michal -p "$GITEA_TOKEN" "$REGISTRY"
|
||||||
|
|
||||||
|
echo "==> Pushing to $REGISTRY/michal/$IMAGE:$TAG..."
|
||||||
|
podman push --tls-verify=false "$REGISTRY/michal/$IMAGE:$TAG"
|
||||||
|
|
||||||
|
# Ensure package is linked to the repository
|
||||||
|
source "$SCRIPT_DIR/link-package.sh"
|
||||||
|
link_package "container" "$IMAGE"
|
||||||
|
|
||||||
|
echo "==> Done!"
|
||||||
|
echo " Image: $REGISTRY/michal/$IMAGE:$TAG"
|
||||||
Reference in New Issue
Block a user