Assuming a docker installation (either boot2docker or just
docker) and a version of 1.3
or higher, we can use Volumes
to enable a portable emacs installation.
To use mine, pull the image:
docker pull biscarch/emacs
set up a function to mount the pwd
at /files
inside the
container and open an emacs at /files
:
NOTE: This is what I have in my .zshrc
; YMMV.
de(){docker run -itv `pwd`:/files biscarch/emacs emacs /files}
Now, in the root of a project run:
cd my_project_rootde
and you’ll be in an emacs. All edits in /files
will
persist to the host:
1 /files:2 total used in directory 52 available 211623043 drwxr-xr-x 1 1000 staff 680 Feb 8 2014 .4 drwxr-xr-x 44 root root 4096 Oct 18 03:44 ..8 -rw-r--r-- 1 1000 staff 101 Aug 16 2013 .ghci9 drwxr-xr-x 1 1000 staff 442 Oct 18 2014 .git10 -rw-r--r-- 1 1000 staff 23 Nov 2 2013 .gitignore13 -rw-r--r-- 1 1000 staff 125 Nov 2 2013 README.md14 drwxr-xr-x 1 1000 staff 68 Sep 15 2013 custom-deps15 drwxr-xr-x 1 1000 staff 170 Feb 8 2014 dist16 drwxr-xr-x 1 1000 staff 136 Feb 8 2014 log17 -rw-r--r-- 1 1000 staff 96 Aug 31 2013 site_key.txt18 drwxr-xr-x 1 1000 staff 136 Feb 8 2014 snaplets19 drwxr-xr-x 1 1000 staff 646 Feb 8 2014 src20 drwxr-xr-x 1 1000 staff 204 Feb 8 2014 static21 -rw-r--r-- 1 1000 staff 2542 Dec 25 2013 tracker.cabal22 -rw-r--r-- 1 1000 staff 602 Dec 30 2013 users.json
To build your own docker-emacs
, check out my
Automated Build
and the
GitHub Repo
for biscarch/emacs