Docker file to build emacs 28 with native compilation (should be faster)
Taken from Mastering Emacs Native Lisp Compilation, with thanks!
Modified to build from ./emacs
git clone https://git.savannah.gnu.org/git/emacs.git apt-get update
source will be in ./emacs now.
docker build -t "emacs-native-comp" .
docker run -it -e DISPLAY -v ~/Projects:/home//Projects --net=host emacs-native-comp
this will give you a bash shell with emacs29 linked to emacs, so just type emacs to start.
This is useful for debugging, especially as the correct .Xauthority file needs to be passed in for graphics to work. We do this in our docker-spacemacs github repo.