Running Emacs in Docker

<2016-12-12 Mon>

I have a complex emacs configuration for my scientific programming workflows. This configuration assumes many external dependencies including:

  • Tex Live
  • Gnuplot
  • ditaa
  • Java
  • Clojure
  • Python (via conda)
    • netcdf4-python
    • matplotlib
    • cartopy
    • jupyter
    • jedi
    • etc.
  • Miscellaneous utilities such as spelling programs

In addition, I curate my own version of org-mode so I can control the version of org-mode I am running.

In order to manage this complexity, I created a Docker container to capture my emacs environment and its many dependencies. Running emacs in a container has several advantages. I can "codify" complex dependencies in a Dockerfile. I also tend to avoid package managers other than brew on my Macbook Pro such as conda to avoid library conflicts that result in programs like meld (a Python program) not working. I realize there are solutions and workarounds to these problems but I appreciate the Docker sandboxing philosophy so I would just as soon choose that option. Finally, I like Docker containers for the defined, reproducible, predictable medium they provide.

My emacs container is fully-featured, but unfortunately it is rather huge. When I save the container image to a file, even compressed, it is 2.5 gigabytes. Being on a fast network is imperative for building or downloading this container.

Finally, I run X11 emacs, which by the way, is no longer maintained by brew. This was the last tricky part but this blog entry showed me how to run GUI programs in Docker on my Macbook Pro.

SourceLast updated on Thu Feb 2 18:39:27 2017 • by Julien Chastang