-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 2.08 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (40 loc) · 2.08 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
47
48
49
50
51
# syntax=docker/dockerfile:1
# Runs altium-designer-mcp in a container: the same `--locked` release build
# the published binaries come from, on a minimal Debian base. Altium itself
# never runs here — the container reads and writes library files under
# /libraries, the only path it may touch, so mount your library folder there:
#
# docker build -t altium-designer-mcp .
# docker run -i --rm -v /path/to/libraries:/libraries altium-designer-mcp
#
# See README.md § Installation. Both stages use the same Debian release so the
# binary links against the glibc it will run on.
# ---- builder ---------------------------------------------------------------
# Pinned to the repository's Rust toolchain (rust-toolchain.toml); the tag is
# held to it by .github/scripts/check-toolchain-pin.sh.
FROM rust:1.95.0-slim-bookworm AS builder
# git + CA certificates: Cargo.toml patches `cfb` to a git revision, which
# cargo fetches over HTTPS.
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
# --locked: the committed Cargo.lock, exactly as CI and the release build use it.
RUN cargo build --locked --release --bin altium-designer-mcp
# ---- runtime ---------------------------------------------------------------
FROM debian:bookworm-slim
LABEL org.opencontainers.image.title="altium-designer-mcp" \
org.opencontainers.image.description="MCP server for AI-assisted Altium Designer component library management" \
org.opencontainers.image.source="https://github.com/embedded-society/altium-designer-mcp" \
org.opencontainers.image.licenses="GPL-3.0-or-later"
# An unprivileged user owning the one folder the server is allowed to use.
RUN useradd --system --create-home --uid 10001 mcp \
&& mkdir -p /libraries \
&& chown mcp:mcp /libraries
COPY --from=builder /src/target/release/altium-designer-mcp /usr/local/bin/altium-designer-mcp
USER mcp
VOLUME ["/libraries"]
# MCP over stdio; the mounted folder is the whole allow-list.
ENTRYPOINT ["altium-designer-mcp"]
CMD ["--allow", "/libraries"]