* Here are some of my notes+URL links on some docker+emacs experiments thus far:
** Last I checked some glimmering developments seem to be coming to light in the docker+emacs realm:
*** Believe some links below might be stepping-stones for your students, Dr. Kitchin:
** Happily, below, I note coming across some work by one of our favorite Elisp hackers of "elnode" fame: Nic Ferrier
** "docker.el" was in development too last I looked into this--see link below.
** These links are slightly tangential but I suggest them since they're also stepping-stones to really what's going on under-the-docker-hood:
* Can run xampp on a docker--see notes and experiments below, here are first checks and steps:
** docker inspect garland/xampp-base docker
** netstat -lnp|grep 8080" ; echo "=>" ; netstat -lnp | grep 8080 ; sleep 3
* Now try to run the xampp container:
docker run -t -i -p 8080:80 garland/xampp-base /bin/bash &
* /opt/lampp/lampp startapache
** xterm -e docker run -i -t debian /bin/bash
** xterm -e docker run -i -t ubuntu /bin/bash
** docker run -i -t debian /bin/bash &
*** xampp on docker!?:
* Enabling XAMPP Web Interface with docker:
Start Docker in interactive mode
[[shell:docker run -t -i -p 8080:80 garland/xampp-base /bin/bash &]]
vim /opt/lampp/etc/extra/httpd-xampp.conf
Remove the bottom 4 lines.docker.el
**** Commented out the bottom 4 lines and then this got it semi-working (returned "Object not found!" error) after I did this:
/opt/lampp/lampp startapache
* [[shell:echo * Put emacs in Docker(but remember all writes will be lost--so to really keep things write to volume(s)):";cd;docker pull biscarch/emacs &]]
** Just mounted a "volume" (to Docker: volumes are read-write(usually) dirs and/or files outside the Union File system (aufs) and available to the host AND the container)
docker run -it --name container-test -h CONTAINER -v /data debian /bin/bash
docker inspect -f {{.Volumes}} container-test => map[/data:/var/lib/docker/vfs/dir/79d22ddf7a12b6e283c74df521289adb6b537883686eb43aa3c2405f0c6aacae]
date > /var/lib/docker/vfs/dir/79d22ddf7a12b6e283c74df521289adb6b537883686eb43aa3c2405f0c6aacae/date.j
root@CONTAINER:/# cat /data/date.j => Mon Jul 20 09:08:33 EDT 2015
In order to be able to save (persist) data and share data between containers, Docker came up with the concept of volumes:
Quite simply, volumes are directories (or files) that are outside of the default Union File System and exist as normal directories and files on the host filesystem.
There are two ways to initialise volumes, with some subtle differences that are important to understand. We can declare a volume at run-time with the -v flag:

$ docker run -it --name container-test -h CONTAINER -v /data debian /bin/bash
root@CONTAINER:/# ls /data
root@CONTAINER:/#
This will make the directory /data inside the container live outside the Union File System and directly accessible on the host.
*** Trying this but fails--may have to do before booting the container?:
docker run -v /home/b/data55:/data55 debian ls /data55
** Can also give access to a "volume" that is available in one container to another
*** Can't you use FUSE with a container!?
** "you can also mount a directory from your own host into a container:"
$ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py
*** The above will mount the local directory, /src/webapp, into the container as the /opt/webapp directory. This is very useful for testing; for example,
we can mount our source code inside the container and see our application at work as we change the source code!
**** But with UNIONFS and AUFS this functionality has been available for many years.
** To test docker install
docker search debian
docker pull debian
docker run -i -t debian /bin/bash
*** And/or
docker pull ubuntu
docker run -i -t ubuntu /bin/bash
docker pull bcbcarl/emacs
sudo chmod +x /usr/local/bin/dmacs
*** This didn't work; but, here's his plan:
This puts Emacs into a docker!
I am sure this is going to be useful for tests and things like that.
Subdirectories
Since there are an immediate load of things you might do with Dockers (run a daemon, run a batch in various ways, etc...) I'll put subdirs here with usable Dockerfiles for doing those things.
emacsd
A docker with an Emacs daemon in it.
$ sudo
docker.io run -d -v $(realpath sockets):/tmp/emacs1000 nicferrier/emacsd
$ emacsclient -s sockets/sock/server -e '(+ 1 1)'
* Other Emacs Dockerfiles
Elnode has a few Dockerfiles to allow quick deployment. So far I've based all the Emacs Dockerfiles I've built on emacsd.
** Other sites:
* Docker Backups
If you’re using a data-container, it’s pretty trivial to do a backup:
$ docker run --rm --volumes-from dbdata -v $(pwd):/backup debian tar cvf /backup/backup.tar /var/lib/postgresql/data
** Above should create a tarball of everything in the volume (the official postgres Dockerfile defines a volume at /var/lib/postgresql/data).