Public Repository

Last pushed: 2 years ago
Short Description
The Emacs OS binaries and shared libraries. Uses busybox for shell utilities.
Full Description

A minimal distribution of Emacs OS 24.4 based off of the busybox image.

This uses the shell utilities from busybox since emacs depends on them.

This image was compiled from a tar file that was compiled on a Ubuntu 14.04 image. The instructions for doing this yourself are below.

Runs an bare bones Busybox/GNU/Emacs OS 24.4 distribution with minimal dependencies.
This uses busybox because emacs depends on external binaries like ls for a few parts of the built in functionality.
It could be based off of scratch and still have most features of Emacs work.

Enter M-x eshell to switch to emacs' shell mode

Replicating this build

On ubuntu:14.04 (I think debian:stable should also work, but haven't tried it)

apt-get update -y
apt-get install -y autoconf gcc libncurses5-dev make texinfo
cd /emacs
ln -s .  emacs     # we create this link to simplify config --prefix of emacs 
cp -a /dev dev     # we boldly copy the whole /dev
mkdir etc sbin tmp # some other directories not installed by emacs
cat >etc/fstab <<EOF
/dev/ubd0 / ext2 defaults  0 1
EOF

cd /root
wget 'http://ftp.gnu.org/gnu/emacs/emacs-24.4.tar.xz'
tar xJf emacs-24.4.tar.xz

cd /root/emacs-24.4
./configure --without-x --prefix=/emacs
make
make install

# TODO: instructions to copy all of the shared libraries
#  mentioned in `ldd /emacs/bin/emacs` to /emacs/lib/emacs
cp /lib/terminfo/ /emacs/lib/terminfo 

cd /emacs
tar czf /emacs-24.4-built.tar.xz *

Get the file with

sudo docker cp <container name>:/emacs-24.4-built.tar.xz built/

Dockerfile

FROM busybox:buildroot-2014.02

MAINTAINER owlowiscious
ADD built/emacs-24.4-built.tar.gz /emacs
RUN ["ln", "-s", "/emacs/lib/terminfo", "/lib/terminfo"]

# Add shell scripts that execute emacs' binaries with the required shared libraries.
ADD run-emacs-bin.sh /usr/bin/run-emacs-bin.sh
RUN for name in ctags ebrowse emacs emacs-24.4 emacsclient etags grep-changelog; do ln -s /usr/bin/run-emacs-bin.sh /usr/bin/$name || exit 1; done

CMD ["/usr/bin/emacs"]

Contents of run-emacs-bin.sh

#!/bin/sh
exec /emacs/lib/ld-linux-x86-64.so.2 --library-path /emacs/lib "/emacs/bin/$(basename -- "$0")"

Bugs

Must enter C-p C-p twice because docker uses C-p to begin control sequences
such as C-p C-q (I think docker makes C-p C-q send C-c to the running process in the container). This is unfixable.

It is possible for users to run vi using busybox vi, which goes against the principles of EmacsOS. TODO: use a version of busybox without vi.

TODO: put this on Github.

Credits

"Busybox/GNU/Emacs OS" uses the wonderful open source projects of GNU/Emacs and Busybox, and was compiled using UBuntu distro's GNU/Linux utilities.

This was inspired by http://www.informatimago.com/linux/emacs-on-user-mode-linux.html
and https://stackoverflow.com/questions/8657908/deploying-yesod-to-heroku-cant-build-statically/8658468?share=1#8658468

Docker Pull Command
Owner
owlowiscious

Comments (0)