Skip to content
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

Merged
merged 10 commits into from
May 21, 2019
Merged

Update Docker Hub #11

merged 10 commits into from
May 21, 2019

Conversation

joshmoore
Copy link
Member

@joshmoore joshmoore commented May 17, 2019

see:

Preparations for a push of new images to docker hub. cF:
Screen Shot 2019-05-17 at 15 48 33

I'll likely re-tag the existing images with something in case something has broken in the meantime.

cc: @olatarkowska @ctrueden @chigozienri

@joshmoore
Copy link
Member Author

[jamoore@idr1-slot2 fiji-dockerfiles]$ for x in openjdk- oracle-jdk; do for y in 6 7; do docker pull fiji/fiji:fiji-$x$y; done; done
...
[jamoore@idr1-slot2 fiji-dockerfiles]$ for x in openjdk- oracle-jdk; do for y in 6 7; do docker tag fiji/fiji:fiji-$x$y fiji/fiji:fiji-$x$y-legacy; done; done
fiji/fiji                                                                    fiji-oracle-jdk7                        4f3616fe21bd        4 years ago         870MB
fiji/fiji                                                                    fiji-oracle-jdk7-legacy                 4f3616fe21bd        4 years ago         870MB
fiji/fiji                                                                    fiji-oracle-jdk6                        0e90cf008100        4 years ago         786MB
fiji/fiji                                                                    fiji-oracle-jdk6-legacy                 0e90cf008100        4 years ago         786MB
fiji/fiji                                                                    fiji-openjdk-6                          d960bb9254be        4 years ago         727MB
fiji/fiji                                                                    fiji-openjdk-6-legacy                   d960bb9254be        4 years ago         727MB
fiji/fiji                                                                    fiji-openjdk-7                          d9016df6262c        4 years ago         876MB
fiji/fiji                                                                    fiji-openjdk-7-legacy                   d9016df6262c        4 years ago         876MB
fiji/fiji                                                                    latest                                  d9016df6262c        4 years ago         876MB
[jamoore@idr1-slot2 fiji-dockerfiles]$ docker push fiji/fiji:fiji-openjdk-7-legacy
The push refers to repository [docker.io/fiji/fiji]
5f70bf18a086: Layer already exists
a584354f99fa: Layer already exists
e7ae6c2513a1: Layer already exists
e75d841cf7bb: Layer already exists
2e71f96ed7ae: Layer already exists
2998cc39c7a6: Layer already exists
d3feddf6984f: Layer already exists
f39162388155: Layer already exists
0ae9a0356259: Layer already exists
230b028ff243: Layer already exists
fiji-openjdk-7-legacy: digest: sha256:99bbb5cdbca29ad5b07fba5245fc0d13eec8884fa8b6be731222f77c5e6d5238 size: 4678

Note: Only pushed fiji-openjdk-7-legacy for the moment, since it is the only tag that will be overwritten by the update.

@joshmoore
Copy link
Member Author

Last commit produces tags of the form:

docker tag fiji/fiji:fiji-openjdk-8 fiji/fiji:fiji-openjdk-8.20190517
docker tag fiji/fiji:fiji-openjdk-7 fiji/fiji:fiji-openjdk-7.20190517
docker push fiji/fiji:fiji-openjdk-8.20190517
docker push fiji/fiji:fiji-openjdk-7.20190517
docker push fiji/fiji:fiji-openjdk-8
docker push fiji/fiji:fiji-openjdk-7
docker tag fiji/fiji:fiji-openjdk-8 fiji/fiji:latest
docker tag fiji/fiji:fiji-openjdk-8 fiji/fiji:20190517
docker push fiji/fiji:latest
docker push fiji/fiji:20190517

@joshmoore
Copy link
Member Author

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
@joshmoore
Copy link
Member Author

joshmoore commented May 17, 2019

Latest state is usable via:

[jamoore@idr1-slot2 fiji-dockerfiles]$ docker run --rm fiji/fiji:fiji-openjdk-8 --ij2 --headless --console --run demo.py 'name="foo"'
Hello foo

@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 latest.

@ctrueden
Copy link
Member

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.

@joshmoore
Copy link
Member Author

I support merging whenever you are confident things are working well.

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 .${today} though)

openjfx needs to be installed separately

Makes sense. I'll likely try to tackle that in a follow-up.

Fiji can run from Docker graphically over X11.

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)

Copy link
Contributor

@atarkowska atarkowska left a 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

fiji-openjdk-8/Dockerfile Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

@atarkowska atarkowska May 20, 2019

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

I dont see any readonly

Copy link
Member Author

@joshmoore joshmoore May 21, 2019

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.

@ctrueden
Copy link
Member

ctrueden commented May 20, 2019

Should we also change the MAINTAINER, since Mark isn't actually the one maintaining this? I looked up that metadata field the other day, and it's deprecated in favor of LABEL, with rather ad hoc semantics, so I didn't say anything till now, but seeing all these logs where it's blasting the wrong MAINTAINER in all capital letters is kinda bothering me now. 😆

@joshmoore
Copy link
Member Author

👍 #15 😉

@joshmoore joshmoore mentioned this pull request May 21, 2019
@joshmoore
Copy link
Member Author

I've pushed to Docker Hub. If everyone is on board, I'll merge this and update fiji/fiji:latest:

fiji-openjdk-8: digest: sha256:0be12c68f5a42b3f319ffce6111be0b097d9c36b1c6237e7b8eb1685b9488572 size: 3251

@joshmoore
Copy link
Member Author

General 👍 from https://gitter.im/fiji/fiji?at=5ce40eef13e9854e33411e9f

Updating the fiji/fiji:latest tag. Enjoy all!

@joshmoore joshmoore closed this May 21, 2019
@joshmoore joshmoore reopened this May 21, 2019
@joshmoore joshmoore merged commit 876bf53 into master May 21, 2019
@joshmoore joshmoore deleted the dh-update branch May 21, 2019 14:47
@joshmoore joshmoore restored the dh-update branch May 21, 2019 16:56
@joshmoore joshmoore deleted the dh-update branch May 22, 2019 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants