Skip to content

Conversation

@adityamparikh
Copy link
Contributor

Summary

This PR adds comprehensive Docker support to the Solr MCP Server project using Google's Jib for containerization and GitHub Actions for automated CI/CD.

Key Features

Jib Integration:

  • Multi-platform Docker images (linux/amd64, linux/arm64)
  • No Docker daemon required for builds
  • Optimized layered images for faster deployments
  • Support for local builds, Docker Hub, and GitHub Container Registry

GitHub Actions Workflow:

  • Automated JAR builds and testing on every push/PR
  • Automated Docker image publishing to GHCR and Docker Hub
  • Smart tagging strategy:
    • Main branch: version-SHA + latest
    • Version tags: semantic version + latest
  • Test results and coverage reports as artifacts

Documentation:

  • Comprehensive README updates with Docker setup guide
  • Integration instructions for Claude Desktop using Docker
  • FAQ explaining why Jib was chosen over Spring Boot Buildpacks
  • Publishing instructions for both Docker Hub and GHCR

Why Jib over Buildpacks?

Jib was chosen because Docker images built with Spring Boot Buildpacks output logs to stdout, which interferes with the MCP protocol's STDIO transport. The MCP protocol requires a clean stdout channel - any extraneous output causes connection errors with MCP clients like Claude Desktop.

Changes

  • Add Jib Gradle plugin (v3.4.5) to gradle/libs.versions.toml
  • Add Jib configuration to build.gradle.kts with multi-platform support
  • Add GitHub Actions workflow (.github/workflows/build-and-publish.yml)
  • Update README with Docker documentation

@adityamparikh
Copy link
Contributor Author

@adityamparikh
Copy link
Contributor Author

FYI @epugh @chatman

@epugh
Copy link
Contributor

epugh commented Oct 28, 2025

just clicked approval on the workflows..

@epugh
Copy link
Contributor

epugh commented Oct 28, 2025

Looks like we need to resolve some conflicts first... Thoughts on how to test this, just maybe go through the docker steps?

# Conflicts:
#	build.gradle.kts
#	gradle/libs.versions.toml
# Conflicts:
#	build.gradle.kts
#	gradle/libs.versions.toml
@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

@adityamparikh do we need to deal with the sonarqube failure in this PR? I think we moved to a differetn tool...

@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

This requires Java 25! Exciting! Do we think there will be issues with adoption if we require Java 25 if this is running "on my local laptop"?

@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

I wonder... should the artifact be called solr-mcp instead of solr-mcp-server since the repo is solr-mcp... Keep the pattern the same! And maybe soemday we include solr-mcp artifact into Solr itself....

@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

I am getting this error on running ./gradlew jibDockerBuild.... I am on an older mac with Intel chip:

➜  solr-mcp git:(pr/6) ✗ ./gradlew jibDockerBuild
> Task :jibDockerBuild FAILED

[Incubating] Problems report is available at: file:///Users/epugh/Documents/projects/solr-mcp/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jibDockerBuild'.
> Check the full stace trace, and if the root cause is from ASM ClassReader about unsupported class file version, see https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#i-am-seeing-unsupported-class-file-major-version-when-building

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.1.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 3s
3 actionable tasks: 1 executed, 2 up-to-date
➜  solr-mcp git:(pr/6) ✗ java --version
openjdk 25.0.1 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)

@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

Same error with ./gradlew jibBuildTar

@epugh
Copy link
Contributor

epugh commented Oct 29, 2025

Yeah, I think we should be solr-mcp everywhere!

@adityamparikh
Copy link
Contributor Author

I am getting this error on running ./gradlew jibDockerBuild.... I am on an older mac with Intel chip:


➜  solr-mcp git:(pr/6) ✗ ./gradlew jibDockerBuild

> Task :jibDockerBuild FAILED



[Incubating] Problems report is available at: file:///Users/epugh/Documents/projects/solr-mcp/build/reports/problems/problems-report.html



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':jibDockerBuild'.

> Check the full stace trace, and if the root cause is from ASM ClassReader about unsupported class file version, see https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#i-am-seeing-unsupported-class-file-major-version-when-building



* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to generate a Build Scan (Powered by Develocity).

> Get more help at https://help.gradle.org.



Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.



You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.



For more on this, please refer to https://docs.gradle.org/9.1.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.



BUILD FAILED in 3s

3 actionable tasks: 1 executed, 2 up-to-date

➜  solr-mcp git:(pr/6) ✗ java --version

openjdk 25.0.1 2025-10-21 LTS

OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)



I can't try this at this moment but I had downgraded to jdk 21 since jib support was not added for jdk 25 but the latest 3.4.7 version should have it GoogleContainerTools/jib@v3.4.5-gradle...v3.4.7-gradle

@adityamparikh adityamparikh changed the title Add Docker support with Jib and GitHub Actions CI/CD feat: Add Docker support with Jib and GitHub Actions CI/CD Oct 31, 2025
@adityamparikh
Copy link
Contributor Author

@epugh #7 will update to solr-mcp everywhere.
Removed sonar and claude. Will use whatever apache org allows us to.

@epugh
Copy link
Contributor

epugh commented Oct 31, 2025

okay, jibBuildDocker is working. jibBuildTar isn't: Execution failed for task ':jibBuildTar'.

com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: multi-platform image building not supported when building a local tar image however I think we can fix that in the next PR!

@epugh epugh merged commit e7642e7 into apache:main Oct 31, 2025
1 check failed
@adityamparikh
Copy link
Contributor Author

Thanks! We may not need a tar output so we may be able to remove it from the doc.

@epugh
Copy link
Contributor

epugh commented Oct 31, 2025

I like less build tooling!

@dsmiley
Copy link
Contributor

dsmiley commented Nov 11, 2025

wow this touched seemingly every source file to format it. Consequently, this is unreviewable. Please never do that in a PR about something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants