Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ RUN mkdir -p /usr/share/maven/conf && \
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' \
'xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 ' \
'http://maven.apache.org/xsd/settings-1.0.0.xsd">' \
'<localRepository>/etc/m2</localRepository>' \
'<localRepository>/etc/m2/repository</localRepository>' \
'</settings>' > /usr/share/maven/conf/settings.xml

# Ensure the /etc/m2 directory exists
RUN mkdir -p /etc/m2
# Ensure the /etc/m2 directory and subdirectories exist
RUN mkdir -p /etc/m2/repository
RUN mkdir -p /etc/m2/jgo_cache

# Set the correct permissions
RUN chmod -R 777 ${EXEC_DIR} && \
Expand All @@ -71,5 +72,11 @@ RUN chmod -R 777 ${EXEC_DIR} && \

RUN python3 -c 'import bfio; bfio.start()'

# Verify that the JAR file exists somewhere within /etc/m2
RUN echo "Verifying JAR files in /etc/m2:" && \
find /etc/m2 -name "formats-gpl-8.0.1.jar" -exec ls -lh {} \; && \
echo "All JAR files in /etc/m2:" && \
find /etc/m2 -name "*.jar" | head -20

# Set the correct permissions again, for sanity
RUN chmod -R 777 /etc/m2
17 changes: 11 additions & 6 deletions docker/imagej/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ RUN python3 -m pip install --upgrade pip --no-cache-dir
# Copy the source
COPY . /bfio_src

# Apply m2 repo patch
RUN git apply --directory=bfio_src /bfio_src/docker/m2_repo.patch

# Install
RUN python3 -m pip install /bfio_src --no-cache-dir

Expand All @@ -64,19 +61,27 @@ RUN mkdir -p /usr/share/maven/conf && \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 \
http://maven.apache.org/xsd/settings-1.0.0.xsd"> \
<localRepository>/etc/m2</localRepository> \
<localRepository>/etc/m2/repository</localRepository> \
</settings>' \
> /usr/share/maven/conf/settings.xml

# Ensure the /etc/m2 directory exists
RUN mkdir -p /etc/m2
# Ensure the /etc/m2 directory and subdirectories exist
RUN mkdir -p /etc/m2/repository
RUN mkdir -p /etc/m2/jgo_cache

# Set the correct permissions
RUN chmod -R 777 ${EXEC_DIR} && \
chmod -R 777 ${DATA_DIR} && \
chmod -R 777 /etc/m2

RUN python3 -c 'import bfio; bfio.start()'

# Verify that the JAR file exists somewhere within /etc/m2
RUN echo "Verifying JAR files in /etc/m2:" && \
find /etc/m2 -name "formats-gpl-8.0.1.jar" -exec ls -lh {} \; && \
echo "First 10 JAR files in /etc/m2:" && \
find /etc/m2 -name "*.jar" | head -10

RUN python3 -c 'import imagej; ij = imagej.init(); print(ij.getVersion())'

# Set the correct permissions again, for sanity
Expand Down
13 changes: 0 additions & 13 deletions docker/jgo_copy.patch

This file was deleted.

5 changes: 2 additions & 3 deletions docker/m2_repo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ diff --git a/src/bfio/utils.py b/src/bfio/utils.py
index 954d682..cb88332 100644
--- a/src/bfio/utils.py
+++ b/src/bfio/utils.py
@@ -40,6 +40,8 @@ try:
@@ -40,6 +40,7 @@ try:

global JAR_VERSION
scyjava.config.endpoints.append("ome:formats-gpl:8.0.1")
+ scyjava.config.set_m2_repo("/etc/m2/")
+ scyjava.config.set_cache_dir("/etc/m2/jgo_cache")
scyjava.start_jvm()
import loci
Expand Down
4 changes: 2 additions & 2 deletions docker/pyimagej_m2repo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ index 18aa9a8..74524ce 100644
+++ b/imagej/__init__.py
@@ -1421,6 +1421,7 @@ def _create_jvm(
sj.config.endpoints.extend(original_endpoints)

try:
+ sj.config.set_m2_repo("/etc/m2/")
+ sj.config.set_cache_dir("/etc/m2/jgo_cache")
sj.start_jvm()
except subprocess.CalledProcessError as e:
# Check to see if initialization failed due to "un-managed"
13 changes: 10 additions & 3 deletions docker/tensorflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ RUN echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" ' \
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' \
'xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 ' \
'http://maven.apache.org/xsd/settings-1.0.0.xsd">' \
'<localRepository>/etc/m2</localRepository>' \
'<localRepository>/etc/m2/repository</localRepository>' \
'</settings>' > /usr/share/maven/conf/settings.xml

# Ensure the /etc/m2 directory exists
RUN mkdir -p /etc/m2
# Ensure the /etc/m2 directory and subdirectories exist
RUN mkdir -p /etc/m2/repository
RUN mkdir -p /etc/m2/jgo_cache

# Set the correct permissions
RUN chmod -R 777 ${EXEC_DIR} && \
Expand All @@ -59,5 +60,11 @@ RUN chmod -R 777 ${EXEC_DIR} && \

RUN python3 -c 'import bfio; bfio.start()'

# Verify that the JAR file exists somewhere within /etc/m2
RUN echo "Verifying JAR files in /etc/m2:" && \
find /etc/m2 -name "formats-gpl-8.0.1.jar" -exec ls -lh {} \; && \
echo "First 10 JAR files in /etc/m2:" && \
find /etc/m2 -name "*.jar" | head -10

# Set the correct permissions again, for sanity
RUN chmod -R 777 /etc/m2