Digikam on Mac OS X or how to use Docker to run a graphical app on Mac OS X

Digikam is a very powerful and convenient KDE application to manage a photo collection (batch renaming, batch auto rotate, modification of geoexif, etc.).

Thing is, Digikam is mainly targeted at Linux distributions; and I’m currently not using a Linux based OS (bad, bad, bad…); so I could follow along the official instructions, such as :

  • get it from mac ports : but I use brew, and mac ports really failed on me several times
  • download it from KDE downloads, ->to be honest, the best solution if you don’t mind installing an untrusted pkg

Since there exists a pkg installer for Mac OS X, you could stop there. But for those Linux UI apps that don’t have a Mac OS X build, read on; as another option would be to use Docker to run Digikam.

Using Docker and the Guacamole based (clientless rdp and vnc) image : aptalca/docker-digikam

This image can be found on Dockerhub, and can be started with the following command line :

provided the folder where you store your pictures is located at  ~/Pictures

Make sure it is started :

Then point your web browser to : (replace the ip address with your local Docker daemon VM)

Screen Shot 2015-10-29 at 21.50.21

Screen Shot 2015-10-29 at 21.50.33

It’s very easy to get started, thanks to the embedded html5 XRDP / VNC client in your browser, but unfortunately, the window can’t be resized dynamically, and since Digikam is run as a non root user (nobody), I had to chmod my ~/Pictures folder to 777, and even with that it never loaded my pictures (probably because of read/write access); so I gave this solution up and tried something more interesting…

Using Docker and X11

This solution is a bit more complicated, but leads to better results, because it is going to connect your Digikam Docker container to your Mac X11 server.

Most of the steps to get it working are coming from this github thread where Slobodan Mišković describes how to wire your X11 sock to a socket, so that your X11 display can be accessible from a container – also, have a look at this article from Jessie Frazelle about running graphical app with Docker

Now, to make this solution work, you need some prerequisites :

  • install brew  a very good package manager for Mac OS X,
  • install caskroom , the brew extension for UI apps :
  • when X11 is installed, make sure it exported its DISPLAY environment  variable, it should look like :

if not, try rebooting (!) your mac, or at least re open your session.

Then run : (it won’t return)

Now you can connect applications to your X11 display server using port 6000; the IP address should be the one assigned to your Virtual Box VM running Docker; use ifconfig locally on your mac to find out your Virtual Box interface IP address :

in my case :
Now you can check this IP address is accessible from a container :

and try starting a graphical linux app, such as one from Jessie Frazelle :

Now on to digikam ! Let’s try using this Digikam Docker Image from Silvano Cirujano Cuesta ; since we are running it on a Mac using X11 on a socket, we need to adapt a little bit the instructions :

:0 means we’ll use the first server, from 6000 X11 default port.

Screen Shot 2015-10-29 at 23.21.38

Not bad , huh ? Don’t forget to enable right-click and middle click from X11 preferences :

Screen Shot 2015-10-29 at 23.24.23