Skip to content

Commit c7fc89c

Browse files
Migrate Docker from Alpine to Debian with multi-arch builds and cross-compilation (#7)
* Initial plan * Update Docker to Debian and add comprehensive CI/CD workflows Co-authored-by: elasticdotventures <[email protected]> * Fix GitHub Actions output redirection syntax Co-authored-by: elasticdotventures <[email protected]> * Update GitHub Actions to use newer versions and improve cross-compilation setup Co-authored-by: elasticdotventures <[email protected]> * Add Docker and pkgx MCP configuration examples to README Co-authored-by: elasticdotventures <[email protected]> --------- Signed-off-by: Brian Horakh <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: elasticdotventures <[email protected]>
1 parent 9eb42c1 commit c7fc89c

File tree

3 files changed

+107
-12
lines changed

3 files changed

+107
-12
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ jobs:
3333
${{ runner.os }}-cargo-
3434
3535
- name: Install Rust toolchain
36-
uses: actions-rs/toolchain@v1
37-
with:
38-
toolchain: 1.91.1
39-
override: true
40-
components: clippy, rustfmt
36+
run: |
37+
rustup toolchain install 1.91.1
38+
rustup default 1.91.1
39+
rustup component add clippy rustfmt
4140
4241
- name: Show rustc & cargo versions
4342
run: |

.github/workflows/release-and-publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v2
25+
uses: docker/setup-qemu-action@v3
2626

2727
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v2
28+
uses: docker/setup-buildx-action@v3
2929

3030
- name: Authenticate to GHCR
31-
uses: docker/login-action@v2
31+
uses: docker/login-action@v3
3232
with:
3333
registry: ghcr.io
3434
username: ${{ github.actor }}
@@ -40,7 +40,7 @@ jobs:
4040
echo "ref_name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
4141
4242
- name: Build and push multi-arch Docker image
43-
uses: docker/build-push-action@v4
43+
uses: docker/build-push-action@v6
4444
with:
4545
context: .
4646
file: ./Dockerfile
@@ -73,10 +73,14 @@ jobs:
7373
strip target/x86_64-unknown-linux-gnu/release/cratedocs || true
7474
7575
- name: Build aarch64-unknown-linux-gnu release binary
76+
env:
77+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
78+
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
79+
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
80+
AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar
7681
run: |
77-
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
7882
cargo build --locked --release --target aarch64-unknown-linux-gnu
79-
strip target/aarch64-unknown-linux-gnu/release/cratedocs || true
83+
aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/cratedocs || true
8084
8185
- name: Upload x86_64 binary to release
8286
uses: softprops/action-gh-release@v1

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,99 @@ in `mcp_settings.json`:
295295
}
296296
```
297297

298-
---
298+
### Using Docker with MCP
299+
300+
You can use the Docker image directly in your MCP configuration:
301+
302+
```json
303+
{
304+
"mcpServers": {
305+
"rust-crate-docs-docker": {
306+
"command": "docker",
307+
"args": [
308+
"run",
309+
"--rm",
310+
"-i",
311+
"ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:latest",
312+
"stdio"
313+
]
314+
}
315+
}
316+
}
317+
```
318+
319+
Or if you want to run the HTTP/SSE server in Docker and connect via mcp-remote:
320+
321+
```bash
322+
# Start the HTTP server in Docker
323+
docker run --rm -p 8080:8080 ghcr.io/promptexecution/rust-cargo-docs-rag-mcp:latest
324+
```
325+
326+
Then in `mcp_settings.json`:
327+
```json
328+
{
329+
"mcpServers": {
330+
"rust-crate-docs-docker-http": {
331+
"command": "bunx",
332+
"args": [
333+
"-y",
334+
"mcp-remote@latest",
335+
"http://localhost:8080/sse",
336+
"--allow-http",
337+
"--transport", "sse-only"
338+
]
339+
}
340+
}
341+
}
342+
```
343+
344+
### Using pkgx with MCP
345+
346+
If you have [pkgx](https://pkgx.dev) installed, you can run the server without a system-wide Rust installation:
347+
348+
```json
349+
{
350+
"mcpServers": {
351+
"rust-crate-docs-pkgx": {
352+
"command": "pkgx",
353+
"args": [
354+
"+rust",
355+
"+cargo",
356+
"cargo",
357+
"run",
358+
"--manifest-path",
359+
"/path/to/rust-cargo-docs-rag-mcp/Cargo.toml",
360+
"--bin",
361+
"cratedocs",
362+
"--",
363+
"stdio"
364+
]
365+
}
366+
}
367+
}
368+
```
369+
370+
Or use pkgx to install and run directly:
371+
372+
```bash
373+
# Clone and install with pkgx
374+
git clone https://github.com/promptexecution/rust-cargo-docs-rag-mcp.git
375+
cd rust-cargo-docs-rag-mcp
376+
pkgx +rust +cargo cargo install --path .
377+
```
378+
379+
Then reference it normally in `mcp_settings.json`:
380+
```json
381+
{
382+
"mcpServers": {
383+
"rust-crate-docs": {
384+
"command": "cratedocs",
385+
"args": ["stdio"]
386+
}
387+
}
388+
}
389+
```
390+
299391

300392
## Implementation Notes
301393

0 commit comments

Comments
 (0)