Quick tip: Check out dev-tools/scripts/scaffoldNewModule.py for an idea of what it takes to add a new module (to src). You probably find some hints on what you need to add to your custom image to make the module system accept it as a module.
There are also other ways you could copy your custom JARs to Solr's classpath, which is really what the module config does. Check dev-docs/plugins-modules-packages.adoc for even more info. Jan > 24. feb. 2026 kl. 10:10 skrev MarcoDaniele Coppola > <[email protected]>: > > Hi, > > I need to use solr with a custom module and I want running it on docker > containers (eg image solr:9.8.1). > > My idea is extend solr image adding the module and the files (sol.xml, > schema.xml, solrconfig.xml, stopwords...) > > My Dockerfile: > > ---------------------------------------------------------------- > FROM solr:9.8.1 > > ENV SOLR_HOME_DIR=/opt/solr-9.8.1/server > > WORKDIR /opt/solr-9.8.1 > > COPY ./modules/hybris ./modules > COPY ./server $SOLR_HOME_DIR > > EXPOSE 8983 > ---------------------------------------------------------------- > > > The build of the image looks fine: > ---------------------------------------------------------------- > => [internal] load local bake definitions > > 0.0s > => => reading from stdin 996B > > 0.0s > => [solr internal] load build definition from Dockerfile > > 0.0s > => => transferring dockerfile: 315B > > 0.0s > => [hybris internal] load build definition from Dockerfile > > 0.0s > => => transferring dockerfile: 1.16kB > > 0.0s > => [solr internal] load metadata for docker.io/library/solr:9.8.1 > > 0.0s > => [hybris internal] load metadata for docker.io/library/sapmachine:17 > > 0.6s > => [solr internal] load .dockerignore > > 0.0s > => => transferring context: 2B > > 0.0s > => [solr 1/5] FROM > docker.io/library/solr:9.8.1@sha256:86a7f3fbec6596b4ee1122b6a862f41eb4b7f41a164abbc169ba9ee03e41525b > > 0.0s > => => resolve > docker.io/library/solr:9.8.1@sha256:86a7f3fbec6596b4ee1122b6a862f41eb4b7f41a164abbc169ba9ee03e41525b > > 0.0s > => [solr internal] load build context > > 0.0s > => => transferring context: 8.50kB > > 0.0s > => CACHED [solr 2/5] RUN whoami > > 0.0s > => CACHED [solr 3/5] WORKDIR /opt/solr-9.8.1 > > 0.0s > => CACHED [solr 4/5] COPY ./modules/hybris ./modules > > 0.0s > => CACHED [solr 5/5] COPY ./server /opt/solr-9.8.1/server > > 0.0s > => [solr] exporting to image > > 0.1s > => => exporting layers > > 0.0s > => => exporting manifest > sha256:49eea1efe83b2aae428b736058fbe03b2efc0e5edf98c4c5f7bde7acb16eaec2 > > 0.0s > => => exporting config > sha256:e80d1a44c69cf024391d347c3f543c4578d66603a5295cbee61aa9fba79088dd > > 0.0s > => => exporting attestation manifest > sha256:71400ef4a2fca497ee6831230d4741877165beb5ee005f9b19f2317111162350 > > 0.0s > => => exporting manifest list > sha256:d547a7f8fe5a41733c95c1053a12de3d5cf7954fc7aa546199e801505a989a38 > > 0.0s > => => naming to docker.io/library/git-solr:latest > > 0.0s > => => unpacking to docker.io/library/git-solr:latest > > 0.0s > => [solr] resolving provenance for metadata file > > 0.0s > ---------------------------------------------------------------- > > The issue is that when I start the container, I have an error, it is missing > the directory of one of the modules > > Below the logs of the container start: > ---------------------------------------------------------------- > Creating solr ... done > Attaching to solr, hybris > solr | Starting Solr > solr | *** [WARN] *** Your open file limit is currently 1024. > solr | It should be set to 65000 to avoid operational disruption. > solr | If you no longer wish to see this warning, set > SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh > solr | Solr will start in SolrCloud mode by default in version 10, and > you will have to provide --user-managed if you want to stay on the > user-managed (aka. standalone) mode. > solr | > solr | Java 17 detected. Enabled workaround for SOLR-16463 > solr | [0.001s][warning][pagesize] UseLargePages disabled, no large > pages configured and available on the system. > solr | CompileCommand: exclude > com/github/benmanes/caffeine/cache/BoundedLocalCache.put bool exclude = true > solr | WARNING: A command line option has enabled the Security Manager > solr | WARNING: The Security Manager is deprecated and will be removed > in a future release > solr | 2026-02-23 15:11:46.056 INFO (main) [c: s: r: x: t:] > o.e.j.s.Server jetty-10.0.22; built: 2024-06-27T16:03:51.502Z; git: > 5c8471e852d377fd726ad9b1692c35ffc5febb09; jvm 17.0.16+8 > solr | 2026-02-23 15:11:46.561 WARN (main) [c: s: r: x: t:] > o.e.j.u.DeprecationWarning Using @Deprecated Class > org.eclipse.jetty.servlet.listener.ELContextCleaner > solr | 2026-02-23 15:11:46.607 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider Using logger factory > org.apache.logging.slf4j.Log4jLoggerFactory > solr | 2026-02-23 15:11:46.621 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider ___ _ Welcome to Apache Solr™ > version 9.8.1 > solr | 2026-02-23 15:11:46.621 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider / __| ___| |_ _ Starting in standalone mode > on port 8983 > solr | 2026-02-23 15:11:46.621 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider \__ \/ _ \ | '_| Install dir: /opt/solr-9.8.1 > solr | 2026-02-23 15:11:46.622 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider |___/\___/_|_| Start time: > 2026-02-23T15:11:46.622705288Z > solr | 2026-02-23 15:11:46.626 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider Solr started with > "-XX:+CrashOnOutOfMemoryError" that will crash on any OutOfMemoryError > exception. The cause of the OOME will be logged in the crash file at the > following path: /var/solr/logs/jvm_crash_14.log > solr | 2026-02-23 15:11:46.677 INFO (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider Solr Home: /var/solr/data (source: system > property: solr.solr.home) > solr | 2026-02-23 15:11:46.740 INFO (main) [c: s: r: x: t:] > o.a.s.c.SolrXmlConfig solr.xml not found in SOLR_HOME, using built-in default > solr | 2026-02-23 15:11:46.740 INFO (main) [c: s: r: x: t:] > o.a.s.c.SolrXmlConfig Loading solr.xml from > /opt/solr-9.8.1/server/solr/solr.xml > solr | 2026-02-23 15:11:46.798 INFO (main) [c: s: r: x: t:] > o.a.s.c.SolrResourceLoader Added 1 libs to classloader, from paths: > [/opt/solr-9.8.1/lib] > solr | 2026-02-23 15:11:47.031 INFO (main) [c: s: r: x: t:] > o.a.s.c.SolrResourceLoader Added 1 libs to classloader, from paths: > [/opt/solr-9.8.1/modules/scripting/lib] > solr | 2026-02-23 15:11:47.031 INFO (main) [c: s: r: x: t:] > o.a.s.c.NodeConfig Added module scripting. > libPath=/opt/solr-9.8.1/modules/scripting/lib with 1 libs > solr | 2026-02-23 15:11:47.033 ERROR (main) [c: s: r: x: t:] > o.a.s.c.NodeConfig No module with name hybris, available modules are > [cross-dc, hadoop-auth, lib, prometheus-exporter, ltr, llm, extraction, > s3-repository, analysis-extras, sql, gcs-repository, analytics, scripting, > jwt-auth, controller-libs, hdfs, jaegertracer-configurator, clustering, > opentelemetry, langid] > solr | 2026-02-23 15:11:47.034 ERROR (main) [c: s: r: x: t:] > o.a.s.s.CoreContainerProvider Could not start Solr. Check solr/home property > and the logs => org.apache.solr.common.SolrException: No module with name > hybris > solr | at > org.apache.solr.core.NodeConfig.initModules(NodeConfig.java:606) > solr | org.apache.solr.common.SolrException: No module with name hybris > solr | at > org.apache.solr.core.NodeConfig.initModules(NodeConfig.java:606) ~[?:?] > solr | at > org.apache.solr.core.NodeConfig.initModules(NodeConfig.java:578) ~[?:?] > solr | at > org.apache.solr.core.NodeConfig.<init>(NodeConfig.java:241) ~[?:?] > solr | at > org.apache.solr.core.NodeConfig$NodeConfigBuilder.build(NodeConfig.java:999) > ~[?:?] > solr | at > org.apache.solr.core.SolrXmlConfig.fillSolrSection(SolrXmlConfig.java:423) > ~[?:?] > solr | at > org.apache.solr.core.SolrXmlConfig.fromConfig(SolrXmlConfig.java:190) ~[?:?] > ... > ---------------------------------------------------------------- > > I checked the running containers and it looks that the solr.xml (and the > others file xml files, stopwords...) are copied but the folder of the modules > (hybris directory) don't is copied. > What wrong? > > > Kind regards > Marco >
