fiji is now available on Docker Hub

Wednesday March 11, 2015

About 12 hours ago an email came in from the fiji-devel mailing list. I couldn’t hide my joy after properly reading the email. It says that Fiji is now available on Docker Hub, and finally it can be run on Docker with its graphical user interface.

Fiji on Elaine Anarchy

To run the Fiji GUI in Docker container on OS X, this is what I did

// if boot2docker is already installed, but powered off.
boot2docker up
$(boot2docker shellinit)

// start the XQuartz
open -a XQuartz

// open a separate terminal window to run the socat
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

// check the IP for the vboxnet
// the IP should be the last entry under vboxnet
// I found "inet 192.168.59.3"
ifconfig

// run the Fiji
// this command will download Docker image "fiji/fiji"
// when the download is complete, it will run the Fiji
docker run -e DISPLAY=192.168.59.3:0 fiji/fiji

the vboxnet inet

The thread is accessible here on fiji-devel. On that thread, you will have the links to a few more resources:

  1. Fiji on Docker Hub
  2. Dockerfiles for Fiji
  3. The instruction on ImageJ wiki

Thank you Mark Hiner for your effort. I should drop by at Wisconsin-Madison soon to say hi and to treat you a good cup of coffee.

Update March 11 2015, 7:48 AM

I tried to edit a LIF file, but I forgot something. By default, a Docker container is isolated, so it cannot open any file outside the container. For a Docker container to open a file outside its container, there’s a volume option, the -v flag.

// the basic format
docker run -v host:container -e DISPLAY=192.168.59.3:0 fiji/fiji

// how I did it
docker run -v /Users/Elaine/Downloads:/fiji/files -e DISPLAY=192.168.59.3:0 fiji/fiji

By issuing this command, I instruct the Docker container to create a new volume (think it like it is just a folder) inside the /fiji directory, and that volume is actually my Downloads folder (from Users/Elaine/Downloads). Why inside the /fiji directory? I took a quick look at the Fiji’s Dockerfile, and I found this:

WORKDIR /fiji

… meaning that you may think this /fiji directory is the $HOME directory for this Docker container.

DockerWithVolumeOption

And now, I am a happy kid.

DockerFijiOpenedALIFFile