-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Docker Hub #11
Conversation
Note: Only pushed |
Last commit produces tags of the form:
|
Updated to use @ctrueden's suggestion of downloading: https://gitter.im/fiji/fiji?at=5cded2ed75d9a575a6fa4a95 |
- use fiji user (id=1000) rather than root - add an entrypoint for sensible defaults - pre-create Java preferences directory - revert to binary rather than ImageJ.sh
Latest state is usable via:
@olatarkowska: I'm thinking for the updates, one should build their own docker image, since otherwise runs won't be reproducible. I can add a build-arg though that will add update sites. We're getting to the stage that I'd suggest deploying the openjdk-8 image as |
Thanks so much for working on this! I'm no Docker expert, so am not qualified to review much of this. I support merging whenever you are confident things are working well. One thing about openjdk8: it does not come bundled with JavaFX; the openjfx needs to be installed separately. So that will be an issue for all the Fiji plugins requiring JavaFX (there are several now). This concern might seem silly since JavaFX is a UI thing, and Docker is typically used headless, but A) there might be class loading issues, and B) I believe Fiji can run from Docker graphically over X11. |
I'll do a little more testing and get confirmation from @olatarkowska, then merge and push to Docker Hub. (Open to tag naming schemes beyond
Makes sense. I'll likely try to tackle that in a follow-up.
I was thinking about adding in Xvfb by default, but perhaps that's an extra image. Likely another next step. NB: I also think the image names can use some shortening. (If anyone out there is following along, feel free to add opinions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating, comments inline
@@ -8,16 +8,25 @@ FROM openjdk:8 | |||
# Define maintainer. | |||
MAINTAINER Mark Hiner <[email protected]> | |||
|
|||
# Create a user. | |||
RUN useradd -u 1000 -ms /bin/bash fiji |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can run container as --user 1000:1000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, but then you can't use --update add-update-site
, etc. can you? Certainly you get a warning from ImageJ warning that the installation is read-only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Details:
$ docker build -t fiji:latest fiji_base
Sending build context to Docker daemon 3.584kB
Step 1/7 : FROM openjdk:8
8: Pulling from library/openjdk
c5e155d5a1d1: Pull complete
221d80d00ae9: Pull complete
4250b3117dca: Pull complete
3b7ca19181b2: Pull complete
1eadaf4c0dff: Pull complete
4c1388ac89fe: Pull complete
73713755b9cb: Pull complete
5784ff1c0372: Pull complete
Digest: sha256:db664aeefa56cb74b1c967089a064c9a1f9d3db33def7eb08c26c2afe8f137f0
Status: Downloaded newer image for openjdk:8
---> bec43387959a
Step 2/7 : MAINTAINER Mark Hiner <[email protected]>
---> Running in 524515e9ffeb
Removing intermediate container 524515e9ffeb
---> 01d838ff7d04
Step 3/7 : WORKDIR /opt/fiji
---> Running in 39b17bdc5757
Removing intermediate container 39b17bdc5757
---> 17635fbcbc06
Step 4/7 : RUN wget -q https://downloads.imagej.net/fiji/latest/fiji-nojre.zip && unzip fiji-nojre.zip && rm fiji-nojre.zip
---> Running in 01db403bf91c
Archive: fiji-nojre.zip
inflating: Fiji.app/db.xml.gz
inflating: Fiji.app/Contents/Info.plist
inflating: Fiji.app/Contents/MacOS/ImageJ-macosx
inflating: Fiji.app/Contents/MacOS/ImageJ-tiger
...
inflating: Fiji.app/retro/retrotranslator-transformer-1.2.9.jar
Removing intermediate container 01db403bf91c
---> 3891fdcac799
Step 5/7 : ENV PATH $PATH:/opt/fiji/Fiji.app
---> Running in 07ddf06b0f97
Removing intermediate container 07ddf06b0f97
---> fde411c2f437
Step 6/7 : COPY entrypoint.sh /opt/fiji
---> ae4684674287
Step 7/7 : ENTRYPOINT ["./entrypoint.sh"]
---> Running in d5f1f226adee
Removing intermediate container d5f1f226adee
---> 1b8de562c55e
Successfully built 1b8de562c55e
Successfully tagged fiji:latest
$ docker build -t fiji_biop:latest fiji
Sending build context to Docker daemon 13.31kB
Step 1/5 : FROM fiji:latest
---> 1b8de562c55e
Step 2/5 : RUN ./entrypoint.sh --update add-update-site PTBIOP http://biop.epfl.ch/Fiji-Update
---> Running in 363adaca211d
Updating the index of available files (Updating from ImageJ site: http://up...
Updating from ImageJ site: http://update.imagej.net/ done
Updating the index of available files (Updating from Fiji site: http://upda...
Updating from Fiji site: http://update.fiji.sc/ done
Updating the index of available files (Updating from Java-8 site: http://si...
Updating from Java-8 site: http://sites.imagej.net/Java-8/ done
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
........................................
Done: Checksummer
Removing intermediate container 363adaca211d
---> a623796983c8
Step 3/5 : RUN ./entrypoint.sh --update update
---> Running in 9c8d726de1f6
Updating the index of available files (Updating from ImageJ site: http://up...
Updating from ImageJ site: http://update.imagej.net/ done
Updating the index of available files (Updating from Fiji site: http://upda...
Updating from Fiji site: http://update.fiji.sc/ done
Updating the index of available files (Updating from Java-8 site: http://si...
Updating from Java-8 site: http://sites.imagej.net/Java-8/ done
Updating the index of available files (Updating from PTBIOP site: http://bi...
Updating from PTBIOP site: http://biop.epfl.ch/Fiji-Update/ done
................................................................................
Done: Checksummer
Step 5/5 : CMD ["--headless"]
---> Running in c538eac03832
Removing intermediate container c538eac03832
---> 293c584578c2
Successfully built 293c584578c2
Successfully tagged fiji_biop:latest
2$ docker run --rm -v /data:/data fiji_biop:latest -macro /data/macro.ijm /data/test#/data/out
May 20, 2019 11:52:32 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
[INFO] Overriding BIOP Run Macro...; identifier: command:ch.epfl.biop.macrorunner.B_Run_Macro; jar: file:/opt/fiji/Fiji.app/plugins/BIOP/B_Run_Macro-1.0.0-SNAPSHOT.jar
[INFO] Overriding Get Spine From Circle Rois; identifier: command:Cirlces_Based_Spine; jar: file:/opt/fiji/Fiji.app/plugins/Max_Inscribed_Circles-1.1.0.jar
Parsing XML File... please wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what dockerfiles you are building from, but I'm going to guess that in your fiji_base you are using USER root
. That's one thing I got rid of. I very much prefer to not run root-based dockers on my systems.
Should we also change the |
👍 #15 😉 |
I've pushed to Docker Hub. If everyone is on board, I'll merge this and update
|
General 👍 from https://gitter.im/fiji/fiji?at=5ce40eef13e9854e33411e9f Updating the |
see:
Preparations for a push of new images to docker hub. cF:
I'll likely re-tag the existing images with something in case something has broken in the meantime.
cc: @olatarkowska @ctrueden @chigozienri