Emacs with native compilation, lsp for go, cpp, python, sh. For both arm and amd architectures.
7.5K
Native Compilation, 24 bit color, LSP, Eglot, Gptel, Gopls, Pyright, Ripgrep, Fzf, Treemacs, HideShow and more. Eliminates trial and error. Runs the same everywhere!
Run directly from the image at dockerhub:
docker run -it --rm --name emacs-native \
--detach-keys="ctrl-q,ctrl-q" \
-v$HOME/src:/root/src \
-v$HOME/.gitconfig:/root/.gitconfig \
-v$HOME/.ssh:/root/.ssh \
-v$HOME/.aws:/root/.aws \
wwarner/emacs-native:latest
Or build it locally
git clone [email protected]:wwarner/emacs-native-dockerfiles.git
cd emacs-native-dockerfiles
make
docker run -it --rm --name emacs-native \
--detach-keys="ctrl-q,ctrl-q" \
-v$HOME/src:/root/src \
-v$HOME/.gitconfig:/root/.gitconfig \
-v$HOME/.ssh:/root/.ssh \
-v$HOME/.aws:/root/.aws \
emacs-native
Emacs lisp can be compiled to native machine code when built
--with-native-compilation enabled, resulting in a perceptible
performance improvement. This image is based on alpine's
emacs-x11-nativecomp for that reason.
gptel, mcp-hub, and a couple of mcps installed.
clangd and bear
go toolchain, dlv, gopls and gofumpt
typescript-language-server, typescript, prettier installed and
configured for js, ts & json
lua-language-server
pyright
bash-language-server
shandy-sqlfmt, sqlfluff
yaml-language-server, helm_ls, indent-tools-minor-mode, also yaml-ts-mode
Treesitter grammars for yaml, javascript, json, typescript and tsx are
installed. Locations for many other languages are captured, so that
treesit-install-grammar works without fuss.
I have been running emacs without windows for several years now because it's so fast and portable. In particular, when working with a lot of data, I find that I need to run emacs on a server in the cloud. Somewhere along the line, I realized that emacs is a lot more fun without graphics. If you want your graphics back, you can try running build/emacs-x11.sh.
24 bit color allows modern themes like zenburn and solarized to work well. Unicode is configured correctly.
All elisp is loaded and compiled in the build image, so that emacs starts very quickly.
M-oM-n and M-pM-KM-0C-; (iedit)M-;; repeat to uncommentC-c <down>; repeat to show it againSearch and replace across many files with wgrep. Find and edit file names with wdired.
This docker image is designed to provide an emacs development environment that works equally well on Mac and Linux machines. However, it works a bit better on Macs because Docker for Desktop is designed to support containerized development while docker on Linux is not. If you run this emacs container on Linux (as I do), you will get a "dubious ownership" error from git unless you configure git to recognize the mounted directories as safe with:
git config --global --add safe.directory /container/path/to/workspace
You can also edit ~/.gitconfig and declare all directories safe
[safe]
directory = *
For commiting to github, you'll need a user stanza as well, so that your commits can be mapped to your github email.
[user]
name = wenjie
email = [email protected]
Either way, mount ~/.gitconfig to /root/.gitconfig to allow git to work inside the container.
In addition to all of that, git needs your ssh keys for all communication with git forges (Github, Gitlab), so those need to be mounted to /root/.ssh as well.
https://github.com/wwarner/emacs-native-dockerfiles
https://hub.docker.com/u/wwarner
Content type
Image
Digest
sha256:375904d53…
Size
1006.5 MB
Last updated
6 months ago
docker pull wwarner/emacs-native