diff --git a/Dockerfile b/Dockerfile index 62ae869..db8b3a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,10 +61,10 @@ WORKDIR /root/src/image-decoders RUN chmod a+x install_openslide.sh RUN ./install_openslide.sh -# temporary fix bc it's looking for .so.0 but has .so.1 -WORKDIR /usr/local/lib -RUN ln -s $(ls | grep libopenslide.so.1) libopenslide.so.0 +ENV LD_LIBRARY_PATH=/usr/local/lib +# temporary fix bc it's looking for .so.0 but has .so.1 +RUN bash openslide_symlink.sh ## Install dummy apt packages against competitor versions being installed WORKDIR /root/src/image-decoders RUN chmod a+x register_openslide_apt.sh diff --git a/build_multiplatform.sh b/build_multiplatform.sh new file mode 100644 index 0000000..cf5fa9d --- /dev/null +++ b/build_multiplatform.sh @@ -0,0 +1,3 @@ +docker buildx create --use +docker buildx build --platform linux/amd64,linux/arm64 -t camicroscope/image_decoders -f Dockerfile . +docker push camicroscope/image_decoders diff --git a/openslide_symlink.sh b/openslide_symlink.sh new file mode 100644 index 0000000..07e89f8 --- /dev/null +++ b/openslide_symlink.sh @@ -0,0 +1,12 @@ +lib_path=$(find /usr/local/lib/ -name 'libopenslide.so.1' -print -quit) + +# Check if libopenslide.so.1 is found +if [ -n "$lib_path" ]; then + # Navigate to the directory containing libopenslide.so.1 + cd "$(dirname "$lib_path")" + + # Create a symbolic link from libopenslide.so.1 to libopenslide.so.0 + ln -s libopenslide.so.1 libopenslide.so.0 +else + echo "libopenslide.so.1 not found in /usr/local/lib/" +fi \ No newline at end of file diff --git a/register_openslide_apt.sh b/register_openslide_apt.sh index e937393..30d358c 100755 --- a/register_openslide_apt.sh +++ b/register_openslide_apt.sh @@ -15,3 +15,5 @@ sed -i 's/libopenslide0/libopenslide-dev/g' libopenslide0 mv libopenslide0 libopenslide-dev equivs-build libopenslide-dev dpkg -i libopenslide-dev_4.1.0_all.deb + +export LD_LIBRARY_PATH=/usr/local/lib \ No newline at end of file