From 691e6184daec8110e1c4f7adf8318910a707142f Mon Sep 17 00:00:00 2001 From: Eric Trautman Date: Thu, 3 Dec 2026 09:40:52 -0500 Subject: [PATCH 1/3] combine render-ws build and deployment RUNs into a single RUN to ensure that cleaned-up libraries are not left in earlier docker layers --- render-ws-with-mongo-db/Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/render-ws-with-mongo-db/Dockerfile b/render-ws-with-mongo-db/Dockerfile index ca3d23442..dc37e8a99 100644 --- a/render-ws-with-mongo-db/Dockerfile +++ b/render-ws-with-mongo-db/Dockerfile @@ -85,20 +85,26 @@ RUN if [ -n "${CORS_ALLOWED_ORIGINS}" ]; then \ ./render-ws/src/main/webapp/WEB-INF/web.xml; \ fi -# 4. Build only the render-app and render-ws modules and skip tests -RUN { echo 'JAVA_HOME="$(readlink -m ./deploy/*jdk*)"'; } >> ~/.mavenrc && \ - mvn --version; mvn --batch-mode --projects ".,render-app,render-ws" -Dproject.build.sourceEncoding=UTF-8 -Dmaven.test.skip package - +# 4. Build only the render-app and render-ws modules and skip tests, then # 5. Deploy Web Service and remove all unneeded source and build artifacts # leaving only render/deploy and render/startup_mongodb_and_jetty.sh # +# The build and the removal must be in the same RUN. Files removed by a later RUN are only hidden, +# they stay in the earlier layer and so in the image, where vulnerability scanners find them. This +# matters for /root/.m2, which holds every library and maven plugin dependency downloaded by the build +# (e.g. an old log4j-core pulled in by a plugin, since pom-scijava's managed versions only apply to +# project dependencies), and for the exploded render-ws/target webapp directory. +# # The neuroglancer build is deployed as its own webapp next to render-ws.war so that it is served # from http://:8080/ng/ . Serving it from the same origin as http://:8080/render-ws/v1/ # avoids the CORS and mixed content restrictions that block a neuroglancer hosted elsewhere from # reading render data over plain http. # # NOTE: the ng copy must happen before the rm -rf below removes the render-ws-with-mongo-db directory. -RUN cp render-ws/target/render-ws-*.war deploy/jetty_base/webapps/render-ws.war && \ +RUN { echo 'JAVA_HOME="$(readlink -m ./deploy/*jdk*)"'; } >> ~/.mavenrc && \ + mvn --version && \ + mvn --batch-mode --projects ".,render-app,render-ws" -Dproject.build.sourceEncoding=UTF-8 -Dmaven.test.skip package && \ + cp render-ws/target/render-ws-*.war deploy/jetty_base/webapps/render-ws.war && \ cp -r ./render-ws-with-mongo-db/ng deploy/jetty_base/webapps/ng && \ rm -rf .[dgi]* Dockerfile LICENSE README.md docker-build-and-push.sh docs examples pom.xml \ render-app render-ws render-ws-java-client render-ws-spark-client render-ws-with-mongo-db trakem2-scripts \ From ad375a5a275ad9bd4302ec761ea8c3be45cf8353 Mon Sep 17 00:00:00 2001 From: Eric Trautman Date: Thu, 3 Dec 2026 09:54:53 -0500 Subject: [PATCH 2/3] Explicitly set jboss-logging version to 3.6.3.Final to avoid 3.4.2.Final version brought in by the resteasy-bom which has a log4j-core 2.11.2 dependency that VM vulnerability scanners report as CVE-2021-45046 . Chose not to upgrade resteasy to a later version (like 6.2.20 or 7.0.6) because that would force a switch from javax.ws.rs to jakarta.* and moving from Jetty 10 to Jetty 11 or 12. --- render-ws/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/render-ws/pom.xml b/render-ws/pom.xml index 02afb1629..b973fd9e1 100644 --- a/render-ws/pom.xml +++ b/render-ws/pom.xml @@ -57,6 +57,14 @@ pom import + + + org.jboss.logging + jboss-logging + ${jboss-logging.version} + @@ -264,6 +272,7 @@ 4.7.9.Final + 3.6.3.Final 10.0.26 4.4.1 gpl_v2 From 75c63a18b911da345619e0262d1b5410c97a3ae1 Mon Sep 17 00:00:00 2001 From: Eric Trautman Date: Thu, 3 Dec 2026 09:58:17 -0500 Subject: [PATCH 3/3] bump render-ws-with-mongodb version to 1.0.9 --- render-ws-with-mongo-db/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/render-ws-with-mongo-db/Dockerfile b/render-ws-with-mongo-db/Dockerfile index dc37e8a99..2dceb8918 100644 --- a/render-ws-with-mongo-db/Dockerfile +++ b/render-ws-with-mongo-db/Dockerfile @@ -11,23 +11,23 @@ # # To build with CORS enabled only for https://neuroglancer-demo.appspot.com (the default build): # cd ${RENDER_REPO_ROOT_DIR} -# docker build --file render-ws-with-mongo-db/Dockerfile --no-cache --build-arg CORS_ALLOWED_ORIGINS='https://neuroglancer-demo.appspot.com' --tag ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 . +# docker build --file render-ws-with-mongo-db/Dockerfile --no-cache --build-arg CORS_ALLOWED_ORIGINS='https://neuroglancer-demo.appspot.com' --tag ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 . # # To build with CORS enabled for all origins (note tag suffix '.cors-star'): # cd ${RENDER_REPO_ROOT_DIR} -# docker build --file render-ws-with-mongo-db/Dockerfile --no-cache --build-arg CORS_ALLOWED_ORIGINS='*' --tag ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8.cors-star . +# docker build --file render-ws-with-mongo-db/Dockerfile --no-cache --build-arg CORS_ALLOWED_ORIGINS='*' --tag ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9.cors-star . # # To run a container in detached mode: -# docker run --publish 8080:8080 --detach --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 +# docker run --publish 8080:8080 --detach --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 # # To run a container in detached mode with the standard MongoDB dump directory mounted: -# docker run --publish 8080:8080 --detach --rm --mount type=bind,source=/mnt/disks/mongodb_dump_fs/dump,target=/mnt/disks/mongodb_dump_fs/dump ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 +# docker run --publish 8080:8080 --detach --rm --mount type=bind,source=/mnt/disks/mongodb_dump_fs/dump,target=/mnt/disks/mongodb_dump_fs/dump ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 # # To run a container with 4GB headroom and the test/two_z_with_four_tiles/mongodb/render collections loaded at startup: -# docker run --publish 8080:8080 --detach --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 4 test/two_z_with_four_tiles/mongodb/render +# docker run --publish 8080:8080 --detach --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 4 test/two_z_with_four_tiles/mongodb/render # # To launch an interactive bash shell within a new container: -# docker run --interactive --tty --publish 8080:8080 --entrypoint /bin/bash --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 +# docker run --interactive --tty --publish 8080:8080 --entrypoint /bin/bash --rm ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 # # To launch an interactive bash shell within an already running container: # docker ps -a # to get the container id @@ -37,7 +37,7 @@ # docker exec --interactive --tty "$(docker ps -q)" /bin/bash # # To push the image to the janeliascicomp containers GitHub registry (see https://github.com/JaneliaSciComp/containers/tree/main): -# docker push ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.8 +# docker push ghcr.io/janeliascicomp/render-ws-with-mongodb:1.0.9 # # Published Containers Notes: # - Before pushing, your docker instance needs to be logged in to GitHub.