From 43886cd02f3247e70664b0c6fcac35b656be5e2d Mon Sep 17 00:00:00 2001 From: Jeremy Muhlich Date: Fri, 5 Jul 2024 17:03:16 -0400 Subject: [PATCH] Restore changes from #21 The maven artifact fetch step introduced in #21 was intermittently failing due to a bug in Java's initial implementation of TLS 1.3. The relevant RUN line in the Dockerfile now forces Java to use TLS 1.2 which seems to fix the problem. Upgrading the base image's conda openjdk package to something much newer (or adding a RUN command to upgrade it here) should also fix the issue but that would be a bit more of an invasive change. --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3f6ed33..c2f86a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,14 @@ ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin: # Installing basicpy and other pip packages RUN pip --no-cache-dir install basicpy==1.2.0 bioformats_jar +# Pre-fetch bioformats jars to a world-readable location. +# Force TLS 1.2 to work around a Java bug in the JDK version in this container. +RUN env JAVA_TOOL_OPTIONS='-Dhttps.protocols=TLSv1.2' \ + python -c 'import bfio; bfio.start()' \ + && mv /root/.jgo /root/.m2 /tmp \ + && chmod -R a+rwX /tmp/.jgo /tmp/.m2 +ENV HOME=/tmp + # Copy script and test run COPY ./main.py /opt/ # RUN mkdir /data