Skip to content

Commit d05f024

Browse files
authored
Merge pull request #26 from BIOP/v0.1.5
v0.1.5
2 parents ca88ea1 + 9a7393a commit d05f024

1 file changed

Lines changed: 88 additions & 48 deletions

File tree

docker/Dockerfile-ms

Lines changed: 88 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
ARG BASE_IMAGE=0.1.0
2-
32
ARG ALIAS=biop/
43

54
# because COPY --from= doesn't support build-arg (https://github.com/docker/for-mac/issues/2155)
65
# we can still do a list of all sub-blocks here to be able to use them in the COPY --from=... below
76
# base needs to be last, Don't Ask Wky ! (I don't know) ! and it seems it need to be named 'base' , D.A:W.2 ! but it works !
87
ARG QUPATH_VERSION=v0.5.1-01
98
ARG ILASTIK_VERSION=1.4.0-gpu
10-
ARG FIJI_VERSION=20240816
9+
ARG FIJI_VERSION=20241008
1110
ARG CELLPOSE_VERSION=2.2.2
1211
ARG DEVBIO_VERSION=0.10.1
1312
ARG SAMAPI_VERSION=0.4.0
@@ -37,41 +36,36 @@ FROM ${ALIAS}biop-vnc-base:${BASE_IMAGE} AS base
3736

3837
USER root
3938

40-
RUN mkdir -p /home/biop/Desktop && chown -R biop:biop /home/biop/Desktop
39+
RUN mkdir -p /home/biop/Desktop \
40+
&& chown -R biop:biop /home/biop/Desktop \
41+
&& mkdir /home/biop/tmp/ \
42+
&& chown -R biop:biop /home/biop/tmp/
4143

4244
#################################################################
4345
# Install QuPath
4446
#
4547
COPY --from=qupath-image /opt/QuPath /opt/QuPath
46-
COPY --from=qupath-image /home/biop/Desktop/QuPath.desktop /home/biop/Desktop/QuPath.desktop
47-
4848
# install Extensions
4949
COPY --from=qupath-image /opt/QuPath/QuPath_Common_Data_0.5 /opt/QuPath/QuPath_Common_Data_0.5
50-
RUN chown -R biop:biop /opt/QuPath/QuPath_Common_Data_0.5 \
51-
&& chmod -R a+rwx /opt/QuPath/QuPath_Common_Data_0.5
50+
# RUN chown -R biop:biop /opt/QuPath/QuPath_Common_Data_0.5 \
51+
# && chmod -R a+rwx /opt/QuPath/QuPath_Common_Data_0.5
5252

5353
# Prepare to set QP_prefs
5454
COPY QuPath/QuPath_setPaths.groovy /home/biop/tmp/QuPath_setPaths.groovy
5555
COPY QuPath/qp_prefs.xml /home/biop/tmp/qp_prefs.xml
56-
RUN chown -R biop:biop /home/biop/tmp
5756
USER biop
5857
# here we import prefs in QuPath so that we can use the extensions at the first start !
5958
RUN /opt/QuPath/bin/QuPath script '/home/biop/tmp/QuPath_setPaths.groovy'
6059
# set back to root to continue installation
6160
USER root
62-
RUN rm -rf /home/biop/tmp
63-
6461

6562
#################################################################
6663
# Install ilastik
6764
COPY --from=ilastik-image /opt/ilastik /opt/ilastik
68-
COPY --from=ilastik-image /home/biop/Desktop/ilastik.desktop /home/biop/Desktop/ilastik.desktop
6965

7066
#################################################################
7167
# Install Fiji
7268
COPY --from=fiji-image /opt/Fiji.app /opt/Fiji.app
73-
COPY --from=fiji-image /home/biop/Desktop/Fiji.desktop /home/biop/Desktop/Fiji.desktop
74-
7569

7670
#################################################################
7771
# From here, we'll install different conda envs
@@ -85,14 +79,14 @@ COPY --from=fiji-image /home/biop/Desktop/Fiji.desktop /home/biop/Desktop/Fiji.d
8579
# Install cellpose and models
8680
COPY --from=cellpose-image /opt/conda/envs/cellpose /opt/conda/envs/cellpose
8781
COPY --from=cellpose-image /home/biop/.cellpose/models/ /home/biop/.cellpose/models/
88-
RUN chmod -R a+rwX /home/biop/.cellpose
82+
#RUN chmod -R a+rwX /home/biop/.cellpose
8983

9084
#################################################################
9185
# Install devbio
9286
COPY --from=devbio-image /opt/conda/envs/devbio /opt/conda/envs/devbio
9387
# create shortcut to start devbio-napari
9488
COPY --from=devbio-image /opt/devbio/ /opt/devbio/
95-
COPY --from=devbio-image /home/biop/Desktop/devbio-napari.desktop /home/biop/Desktop/devbio-napari.desktop
89+
9690

9791
#################################################################
9892
# Install samapi
@@ -103,13 +97,14 @@ ENV LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
10397
COPY --from=samapi-image /opt/conda/envs/samapi /opt/conda/envs/samapi
10498
# add models for samapi
10599
COPY --from=samapi-image /home/biop/.samapi/ /home/biop/.samapi/
106-
RUN chown -R biop:biop /home/biop/.samapi/ \
107-
&& chmod -R a+rwX /home/biop/.samapi/
100+
# RUN chown -R biop:biop /home/biop/.samapi/ \
101+
# && chmod -R a+rwX /home/biop/.samapi/
102+
108103
# create shortcut to start SAMAPI
109104
# because it's a QuPath extension I add (ico & sh) to the QuPath Common Data folder
110105
# but we could also have them in /opt/samapi , as we have for empanada (see below)
111106
COPY --from=samapi-image /opt/samapi/ /opt/samapi/
112-
COPY --from=samapi-image /home/biop/Desktop/samapi.desktop /home/biop/Desktop/samapi.desktop
107+
113108

114109
#################################################################
115110
# Install empanada
@@ -118,20 +113,17 @@ COPY --from=samapi-image /home/biop/Desktop/samapi.desktop /home/biop/Desktop/sa
118113
COPY --from=empanada-image /opt/conda/envs/empanada /opt/conda/envs/empanada
119114
# add shortcut to start empanada
120115
COPY --from=empanada-image /opt/empanada /opt/empanada
121-
COPY --from=empanada-image /home/biop/Desktop/empanada.desktop /home/biop/Desktop/empanada.desktop
122-
# TODO ? download model, it's a light one so we can download it on demand
123116

124117
#################################################################
125118
# Install stardist
126119
COPY --from=stardist-image /opt/conda/envs/stardist /opt/conda/envs/stardist
127120

128121
#################################################################
129122
# Install abba
130-
COPY --from=abba-image /home/biop/Desktop/abba.desktop /home/biop/Desktop/abba.desktop
131123
COPY --from=abba-image /opt/abba /opt/abba
132124
# set permissions , includes /opt/abba/cached_atlas/
133-
RUN chown -R biop:biop /opt/abba/ \
134-
&& chmod -R a+rwX /opt/abba/
125+
# RUN chown -R biop:biop /opt/abba/ \
126+
# && chmod -R a+rwX /opt/abba/
135127

136128
# install abba_python env
137129
COPY --from=abba-image /opt/conda/envs/abba_python/ /opt/conda/envs/abba_python/
@@ -140,44 +132,43 @@ COPY --from=abba-image /opt/conda/envs/abba_python/ /opt/conda/envs/abba_python/
140132
COPY --from=abba-image /opt/conda/envs/deepslice/ /opt/conda/envs/deepslice/
141133

142134
# and make deepslice_cli_v1.1.5.1.py executable
143-
RUN chown biop:biop /opt/conda/envs/deepslice/ \
144-
&& chmod a+rwx /opt/conda/envs/deepslice/deepslice_cli_v1.1.5.1.py
135+
# RUN chown biop:biop /opt/conda/envs/deepslice/ \
136+
# && chmod a+rwx /opt/conda/envs/deepslice/deepslice_cli_v1.1.5.1.py
145137

146138
# change permission of atlases
147139
# should be copy with the COPY above # COPY --from=abba-image /opt/conda/envs/deepslice/lib/site-packages/DeepSlice/metadata/weights/ /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/
148-
RUN chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/xception_weights_tf_dim_ordering_tf_kernels.h5 \
149-
&& chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Allen_Mixed_Best.h5 \
150-
&& chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Synthetic_data_final.hdf5
140+
# RUN chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/xception_weights_tf_dim_ordering_tf_kernels.h5 \
141+
# && chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Allen_Mixed_Best.h5 \
142+
# && chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Synthetic_data_final.hdf5
151143

152144
# add elastix
153145
COPY --from=abba-image /opt/elastix /opt/elastix
154-
RUN chown -R biop:biop /opt/elastix \
155-
&& chmod a+rwx /opt/elastix/bin/elastix \
156-
&& chmod a+rwx /opt/elastix/bin/transformix
146+
# RUN chown -R biop:biop /opt/elastix \
147+
# && chmod a+rwx /opt/elastix/bin/elastix \
148+
# && chmod a+rwx /opt/elastix/bin/transformix
157149
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/elastix/lib
158150

159151
# Test if ABBA works again with all rights
160-
RUN chown biop:biop /opt/Fiji.app/ \
161-
&& chmod -R a+rwx /opt/Fiji.app/
152+
# RUN chown biop:biop /opt/Fiji.app/ \
153+
# && chmod -R a+rwx /opt/Fiji.app/
162154

163155
# set FIJI prefs (elastix, cellpose , stardist), and adds text to set the path to atlases
164156
COPY fiji/Fiji_setWrappersPaths.groovy /home/biop/tmp/Fiji_setWrappersPaths.groovy
165-
RUN chown -R biop:biop /home/biop/tmp \
166-
&& chmod -R a+rwX /home/biop/tmp
157+
# RUN chown -R biop:biop /home/biop/tmp \
158+
# && chmod -R a+rwX /home/biop/tmp
167159

168160
# add brainrender-napari env
169161
COPY --from=brainrender-image /opt/conda/envs/brainrender /opt/conda/envs/brainrender
170162

171163
USER biop
172-
RUN /opt/Fiji.app/ImageJ-linux64 --headless --run /home/biop/tmp/Fiji_setWrappersPaths.groovy
173-
174-
# download allen_mouse_25um atlas from brainrender-napari
175-
RUN source activate brainrender \
164+
# set the paths to the wrappers in Fiji
165+
RUN /opt/Fiji.app/ImageJ-linux64 --headless --run /home/biop/tmp/Fiji_setWrappersPaths.groovy \
166+
# download allen_mouse_25um atlas from brainrender-napari
167+
&& source activate brainrender \
176168
&& brainglobe install -a allen_mouse_25um \
177169
&& conda deactivate
178170

179171
USER root
180-
RUN rm -rf /home/biop/tmp
181172

182173
# a text file to specify where the atlases are
183174
COPY --from=abba-image /opt/Fiji.app/plugins/BIOP/ABBA_Atlas_folder.txt /opt/Fiji.app/plugins/BIOP/ABBA_Atlas_folder.txt
@@ -187,7 +178,6 @@ COPY --from=abba-image /opt/Fiji.app/plugins/BIOP/ABBA_Atlas_folder.txt /opt/Fij
187178
COPY --from=cellprofiler-image /opt/conda/envs/cellprofiler /opt/conda/envs/cellprofiler
188179
# create shortcut to start cellprofiler
189180
COPY --from=cellprofiler-image /opt/cellprofiler /opt/cellprofiler
190-
COPY --from=cellprofiler-image /home/biop/Desktop/cellprofiler.desktop /home/biop/Desktop/cellprofiler.desktop
191181

192182
#################################################################
193183
# Add the inkscape-imagej-panel extension for inskcape
@@ -206,8 +196,6 @@ COPY --from=omnipose-image /opt/conda/envs/omnipose/ /opt/conda/envs/omnipose/
206196
# To make the different conda env available in jupyter
207197
COPY jupyter/kernels/ /home/biop/.local/share/jupyter/kernels/
208198

209-
210-
211199
#################################################################
212200
# TODO : put back with inkscape installation
213201
# replace inkscape from base with the one from the inkscape-image (newer)
@@ -216,17 +204,69 @@ RUN sudo apt-get update -y \
216204
&& sudo apt-get update -y \
217205
&& sudo add-apt-repository ppa:inkscape.dev/stable \
218206
&& sudo apt-get update -y \
219-
&& sudo apt-get install inkscape -y
207+
&& sudo apt-get install inkscape -y
208+
# && apt-get autoremove --purge \
209+
# && apt-get clean \
210+
# && rm -rf /var/lib/apt/lists/* \
211+
# && rm -rf /tmp/* \
212+
# && find /var/log -type f -exec cp /dev/null \{\} \;
220213

221214
# Install Inkscape extension
222215
# and the inkscape_modules environment
223216
# get a "docker: Error response from daemon: max depth exceeded."
224217
#COPY --from=inkscape-image /opt/conda/envs/inkscape_modules/ /opt/conda/envs/inkscape_modules/
225218

226-
#################################################################
227-
# final chown and chmod
228-
RUN chown -R biop:biop /home/biop/ \
229-
&& chmod -R a+rwx /home/biop/
219+
# Replace copy of icons of all tools with a single run that printf all of them
220+
# COPY --from=qupath-image /home/biop/Desktop/QuPath.desktop /home/biop/Desktop/QuPath.desktop # DONE
221+
# COPY --from=ilastik-image /home/biop/Desktop/ilastik.desktop /home/biop/Desktop/ilastik.desktop
222+
# COPY --from=fiji-image /home/biop/Desktop/Fiji.desktop /home/biop/Desktop/Fiji.desktop
223+
# COPY --from=devbio-image /home/biop/Desktop/devbio-napari.desktop /home/biop/Desktop/devbio-napari.desktop
224+
# COPY --from=samapi-image /home/biop/Desktop/samapi.desktop /home/biop/Desktop/samapi.desktop
225+
# COPY --from=empanada-image /home/biop/Desktop/empanada.desktop /home/biop/Desktop/empanada.desktop
226+
# COPY --from=abba-image /home/biop/Desktop/abba.desktop /home/biop/Desktop/abba.desktop
227+
# COPY --from=cellprofiler-image /home/biop/Desktop/cellprofiler.desktop /home/biop/Desktop/cellprofiler.desktop
228+
229+
# create shortcuts to start the different tools and chown and chmod folders
230+
RUN printf '[Desktop Entry]\nVersion=0.5.1\nName=qupath\nGenericName=QuPath\nX-GNOME-FullName=QuPath\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/QuPath/bin/QuPath\nTryExec=/opt/QuPath/bin/QuPath\nTerminal=false\nStartupNotify=true\nIcon=/opt/QuPath/lib/QuPath.png\nStartupWMClass=QuPath' > /home/biop/Desktop/QuPath.desktop \
231+
&& printf '[Desktop Entry]\nVersion=1.4.0\nName=ilastik\nGenericName=ilastik\nX-GNOME-FullName=ilastik\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/ilastik/run_ilastik.sh %F\nTryExec=/opt/ilastik/run_ilastik.sh\nTerminal=false\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/ilastik/lib/python3.7/site-packages/ilastik/shell/gui/icons/96x96/ilastik-icon.png\nStartupWMClass=ilastik\n' > /home/biop/Desktop/ilastik.desktop \
232+
&& printf '[Desktop Entry]\nVersion=1.0\nName=ImageJ\nGenericName=ImageJ\nX-GNOME-FullName=ImageJ\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/Fiji.app/ImageJ-linux64 %F\nTryExec=/opt/Fiji.app/ImageJ-linux64\nTerminal=false\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/Fiji.app/images/icon.png\nStartupWMClass=net-imagej-launcher-ClassLauncher\n' > /home/biop/Desktop/Fiji.desktop \
233+
&& printf '[Desktop Entry]\nVersion=0.10.1\nName=devbio-napari\nGenericName=devbio-napari\nX-GNOME-FullName=devbio-napari\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/devbio/start_devbio.sh\nTryExec=/opt/devbio/start_devbio.sh\nTerminal=true\nStartupNotify=true\nIcon=/opt/devbio/napari-icon.ico\nStartupWMClass=devbio-napari\n' > /home/biop/Desktop/devbio-napari.desktop \
234+
&& printf '[Desktop Entry]\nVersion=0.3.0\nName=samapi\nGenericName=samapi\nX-GNOME-FullName=samapi\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/samapi/start_samapi.sh\nTryExec=/opt/samapi/start_samapi.sh\nTerminal=true\nStartupNotify=true\nIcon=/opt/samapi/samapi.ico\nStartupWMClass=samapi\n' > /home/biop/Desktop/samapi.desktop \
235+
&& printf '[Desktop Entry]\nVersion=0.2.3\nName=empanada\nGenericName=empanada\nX-GNOME-FullName=empanada\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/empanada/start_empanada.sh\nTryExec=/opt/empanada/start_empanada.sh\nTerminal=true\nStartupNotify=true\nIcon=/opt/empanada/empanada_icon.png\nStartupWMClass=empanada\n' > /home/biop/Desktop/empanada.desktop \
236+
&& printf '[Desktop Entry]\nVersion=0.8.0\nName=ABBA\nGenericName=ABBA\nX-GNOME-FullName=ABBA\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/abba/start_abba.sh\nTryExec=/opt/abba/start_abba.sh\nTerminal=true\nStartupNotify=true\nMimeType=image/*;\nIcon=/opt/abba/logo256x256.png\nStartupWMClass=ABBA\n' > /home/biop/Desktop/abba.desktop \
237+
&& printf '[Desktop Entry]\nVersion=4.2.6\nName=cellprofiler\nGenericName=cellprofiler\nX-GNOME-FullName=cellprofiler\nComment=Scientific Image Analysis\nType=Application\nCategories=Education;Science;ImageProcessing;\nExec=/opt/cellprofiler/start_cellprofiler.sh\nTryExec=/opt/cellprofiler/start_cellprofiler.sh\nTerminal=true\nStartupNotify=true\nIcon=/opt/cellprofiler/CellProfiler.ico\nStartupWMClass=cellprofiler\n' > /home/biop/Desktop/cellprofiler.desktop \
238+
&& chown -R biop:biop /home/biop/ \
239+
&& chmod -R a+rwx /home/biop/ \
240+
&& rm -rf /home/biop/tmp \
241+
&& ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so
242+
243+
## quick fix for the atlas download error TODO: update to latest Fiji-ABBA , and remove this with next fiji update
244+
RUN wget https://maven.scijava.org/content/repositories/releases/ch/epfl/biop/atlas/0.3.1/atlas-0.3.1.jar -O /opt/Fiji.app/jars/atlas-0.3.1.jar \
245+
&& rm -f /opt/Fiji.app/jars/atlas-0.2.2.jar
246+
247+
# chown and chmod for all
248+
RUN chown -R biop:biop /opt/QuPath/QuPath_Common_Data_0.5 \
249+
&& chmod -R a+rwx /opt/QuPath/QuPath_Common_Data_0.5 \
250+
# cellpose models
251+
&& chmod -R a+rwx /home/biop/.cellpose \
252+
&& chown -R biop:biop /home/biop/.samapi/ \
253+
&& chmod -R a+rwx /home/biop/.samapi/ \
254+
# abba
255+
&& chown -R biop:biop /opt/abba/ \
256+
&& chmod -R a+rwx /opt/abba/ \
257+
# deepslice
258+
&& chown biop:biop /opt/conda/envs/deepslice/ \
259+
&& chmod a+rwx /opt/conda/envs/deepslice/deepslice_cli_v1.1.5.1.py \
260+
&& chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/xception_weights_tf_dim_ordering_tf_kernels.h5 \
261+
&& chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Allen_Mixed_Best.h5 \
262+
&& chmod a+rwx /opt/conda/envs/deepslice/lib/python3.7/site-packages/DeepSlice/metadata/weights/Synthetic_data_final.hdf5 \
263+
# elastix
264+
&& chown -R biop:biop /opt/elastix \
265+
&& chmod a+rwx /opt/elastix/bin/elastix \
266+
&& chmod a+rwx /opt/elastix/bin/transformix \
267+
# fiji
268+
&& chown biop:biop /opt/Fiji.app/ \
269+
&& chmod -R a+rwx /opt/Fiji.app/
230270

231271
#################################################################
232272
# Container start

0 commit comments

Comments
 (0)