@@ -71,8 +71,129 @@ centrally managed in `gradle/libs.versions.toml`.
7171
7272The build produces two JAR files in ` build/libs/ ` :
7373
74- - ` solr-mcp-server-0.0.1-SNAPSHOT.jar ` - Executable JAR with all dependencies (fat JAR)
75- - ` solr-mcp-server-0.0.1-SNAPSHOT-plain.jar ` - Plain JAR without dependencies
74+ - ` solr-mcp-0.0.1-SNAPSHOT.jar ` - Executable JAR with all dependencies (fat JAR)
75+ - ` solr-mcp-0.0.1-SNAPSHOT-plain.jar ` - Plain JAR without dependencies
76+
77+ ### 4. Building Docker Images (Optional)
78+
79+ This project uses [ Jib] ( https://github.com/GoogleContainerTools/jib ) to build optimized Docker images without requiring
80+ Docker installed. Jib creates layered images for faster rebuilds and smaller image sizes.
81+
82+ #### Option 1: Build to Docker Daemon (Recommended)
83+
84+ Build directly to your local Docker daemon (requires Docker installed):
85+
86+ ``` bash
87+ ./gradlew jibDockerBuild
88+ ```
89+
90+ This creates a local Docker image: ` solr-mcp:0.0.1-SNAPSHOT `
91+
92+ Verify the image:
93+
94+ ``` bash
95+ docker images | grep solr-mcp
96+ ```
97+
98+ #### Option 2: Build to Tar File (No Docker Required)
99+
100+ Build to a tar file without Docker installed:
101+
102+ ``` bash
103+ ./gradlew jibBuildTar
104+ ```
105+
106+ This creates ` build/jib-image.tar ` . Load it into Docker:
107+
108+ ``` bash
109+ docker load < build/jib-image.tar
110+ ```
111+
112+ #### Option 3: Push to Docker Hub
113+
114+ Authenticate with Docker Hub and push:
115+
116+ ``` bash
117+ # Login to Docker Hub
118+ docker login
119+
120+ # Build and push
121+ ./gradlew jib -Djib.to.image=YOUR_DOCKERHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT
122+ ```
123+
124+ #### Option 4: Push to GitHub Container Registry
125+
126+ Authenticate with GitHub Container Registry and push:
127+
128+ ``` bash
129+ # Create a Personal Access Token (classic) with write:packages scope at:
130+ # https://github.com/settings/tokens
131+
132+ # Login to GitHub Container Registry
133+ export GITHUB_TOKEN=YOUR_GITHUB_TOKEN
134+ echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin
135+
136+ # Build and push
137+ ./gradlew jib -Djib.to.image=ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT
138+ ```
139+
140+ #### Multi-Platform Support
141+
142+ The Docker images are built with multi-platform support for:
143+
144+ - ` linux/amd64 ` (Intel/AMD 64-bit)
145+ - ` linux/arm64 ` (Apple Silicon M1/M2/M3)
146+
147+ #### Automated Builds with GitHub Actions
148+
149+ This project includes a GitHub Actions workflow that automatically builds and publishes Docker images to both GitHub
150+ Container Registry and Docker Hub.
151+
152+ ** Triggers:**
153+
154+ - Push to ` main ` branch - Builds and publishes images tagged with ` version-SHA ` and ` latest `
155+ - Version tags (e.g., ` v1.0.0 ` ) - Builds and publishes images tagged with the version number and ` latest `
156+ - Pull requests - Builds and tests only (no publishing)
157+
158+ ** Published Images:**
159+
160+ - GitHub Container Registry: ` ghcr.io/OWNER/solr-mcp:TAG `
161+ - Docker Hub: ` DOCKERHUB_USERNAME/solr-mcp:TAG `
162+
163+ ** Setup for Docker Hub Publishing:**
164+
165+ To enable Docker Hub publishing, configure these repository secrets:
166+
167+ 1 . Go to your GitHub repository Settings > Secrets and variables > Actions
168+ 2 . Add the following secrets:
169+ - ` DOCKERHUB_USERNAME ` : Your Docker Hub username
170+ - ` DOCKERHUB_TOKEN ` : Docker Hub access token (create at https://hub.docker.com/settings/security )
171+
172+ ** Note:** GitHub Container Registry publishing works automatically using the ` GITHUB_TOKEN ` provided by GitHub Actions.
173+
174+ #### Running the Docker Container
175+
176+ Run the container with STDIO mode:
177+
178+ ``` bash
179+ docker run -i --rm solr-mcp:0.0.1-SNAPSHOT
180+ ```
181+
182+ Or with custom Solr URL:
183+
184+ ``` bash
185+ docker run -i --rm \
186+ -e SOLR_URL=http://your-solr-host:8983/solr/ \
187+ solr-mcp:0.0.1-SNAPSHOT
188+ ```
189+
190+ ** Note for Linux users:** If you need to connect to Solr running on the host machine, add the ` --add-host ` flag:
191+
192+ ``` bash
193+ docker run -i --rm \
194+ --add-host=host.docker.internal:host-gateway \
195+ solr-mcp:0.0.1-SNAPSHOT
196+ ```
76197
77198### 4. Building Docker Images (Optional)
78199
@@ -343,7 +464,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
343464 "command" : " java" ,
344465 "args" : [
345466 " -jar" ,
346- " /absolute/path/to/solr-mcp-server /build/libs/solr-mcp-server -0.0.1-SNAPSHOT.jar"
467+ " /absolute/path/to/solr-mcp/build/libs/solr-mcp-0.0.1-SNAPSHOT.jar"
347468 ],
348469 "env" : {
349470 "SOLR_URL" : " http://localhost:8983/solr/" ,
@@ -354,7 +475,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
354475}
355476```
356477
357- ** Note:** Replace ` /absolute/path/to/solr-mcp-server ` with the actual path to your project directory.
478+ ** Note:** Replace ` /absolute/path/to/solr-mcp ` with the actual path to your project directory.
358479
359480### Option 2: Using Docker Container
360481
@@ -377,7 +498,7 @@ You can add this MCP server to Claude Desktop using either the JAR file or Docke
377498 " run" ,
378499 " -i" ,
379500 " --rm" ,
380- " solr-mcp-server :0.0.1-SNAPSHOT"
501+ " solr-mcp:0.0.1-SNAPSHOT"
381502 ],
382503 "env" : {
383504 "SOLR_URL" : " http://localhost:8983/solr/"
@@ -403,7 +524,7 @@ host:
403524 " -i" ,
404525 " --rm" ,
405526 " --add-host=host.docker.internal:host-gateway" ,
406- " solr-mcp-server :0.0.1-SNAPSHOT"
527+ " solr-mcp:0.0.1-SNAPSHOT"
407528 ],
408529 "env" : {
409530 "SOLR_URL" : " http://host.docker.internal:8983/solr/"
@@ -428,7 +549,7 @@ If you've pushed the image to Docker Hub or GitHub Container Registry, you can u
428549 " run" ,
429550 " -i" ,
430551 " --rm" ,
431- " YOUR_DOCKERHUB_USERNAME/solr-mcp-server :0.0.1-SNAPSHOT"
552+ " YOUR_DOCKERHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT"
432553 ],
433554 "env" : {
434555 "SOLR_URL" : " http://localhost:8983/solr/"
@@ -449,7 +570,7 @@ If you've pushed the image to Docker Hub or GitHub Container Registry, you can u
449570 " run" ,
450571 " -i" ,
451572 " --rm" ,
452- " ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp-server :0.0.1-SNAPSHOT"
573+ " ghcr.io/YOUR_GITHUB_USERNAME/solr-mcp:0.0.1-SNAPSHOT"
453574 ],
454575 "env" : {
455576 "SOLR_URL" : " http://localhost:8983/solr/"
0 commit comments