-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (39 loc) · 2.18 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (39 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM debian:bookworm-slim
# Framework version pinning for reproducible builds
# Update this when upgrading to a new framework version
ARG FRAMEWORK_VERSION=v0.9.6
# SHA256 for the GitHub tag archive (https://github.com/yaniv-golan/mcp-bash-framework/archive/refs/tags/<version>.tar.gz)
ARG FRAMEWORK_SHA256=67779bc7ba5cb9df44a0cebc9b373b0f92d3f9925bc364c5e8a6c09f6d2b5738
ENV XDG_DATA_HOME=/root/.local/share
ENV PATH="/root/.local/bin:${PATH}"
RUN apt-get update && \
apt-get install -y bash jq git ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
# Copy tool (and optionally vendored framework)
COPY . /app
WORKDIR /app
# Prefer a vendored framework if present; otherwise install the pinned tag archive tarball with verification.
RUN set -euo pipefail; \
mkdir -p "${XDG_DATA_HOME}" /root/.local/bin; \
if [ -x "/app/mcp-bash-framework/bin/mcp-bash" ]; then \
ln -snf "/app/mcp-bash-framework" "${XDG_DATA_HOME}/mcp-bash"; \
else \
tmp="/tmp/mcp-bash.tgz"; \
url="https://github.com/yaniv-golan/mcp-bash-framework/archive/refs/tags/${FRAMEWORK_VERSION}.tar.gz"; \
echo "Downloading mcp-bash framework ${FRAMEWORK_VERSION}..." >&2; \
curl -fsSL "${url}" -o "${tmp}"; \
if [ -n "${FRAMEWORK_SHA256}" ]; then \
echo "${FRAMEWORK_SHA256} ${tmp}" | sha256sum -c - >/dev/null; \
else \
echo "Warning: No SHA256 provided, skipping verification" >&2; \
fi; \
mkdir -p "${XDG_DATA_HOME}/mcp-bash"; \
tar -xzf "${tmp}" -C "${XDG_DATA_HOME}/mcp-bash" --strip-components 1; \
rm -f "${tmp}"; \
fi; \
ln -snf "${XDG_DATA_HOME}/mcp-bash/bin/mcp-bash" /root/.local/bin/mcp-bash
ENV MCPBASH_PROJECT_ROOT=/app
# mcp-bash-framework v0.7.0+: tool execution is deny-by-default unless allowlisted.
# Default to the full git-hex tool set; callers can override at runtime.
ENV MCPBASH_TOOL_ALLOWLIST="git-hex-getRebasePlan git-hex-checkRebaseConflicts git-hex-getConflictStatus git-hex-rebaseWithPlan git-hex-splitCommit git-hex-createFixup git-hex-amendLastCommit git-hex-cherryPickSingle git-hex-resolveConflict git-hex-continueOperation git-hex-abortOperation git-hex-undoLast"
ENTRYPOINT ["mcp-bash"]