A containerized Emacs GUI environment using Alpine Linux with native compilation support and Wayland compatibility.
- Emacs PGTK with native compilation support
- Wayland and X11 compatibility
- Pre-configured development tools: ripgrep, fd, git
- Spell checking: aspell, hunspell with English dictionaries
- GPG integration with pinentry support
- Modern fonts: JetBrains Mono Nerd Font, Noto Emoji, DejaVu
- Lightweight: Based on Alpine Linux 3.22.1
podman build -t emacs-gui .
# or
docker build -t emacs-gui .(change tsb for whatever your user is)
podman run -it --rm \
    --name emacs-gui --userns keep-id \
    -e WAYLAND_DISPLAY \
    -e EMACS_CONTAINER=1 \
    -v $XDG_RUNTIME_DIR:/tmp/runtime-1000:ro \
    -v ~/.config/emacs:/home/tsb/.config/emacs:Z \
    -v ~/.cache/neodoom:/home/tsb/.cache/neodoom:Z \
    --device /dev/dri \
    --security-opt label=disable \
    emacs-gui
(change tsb for whatever your user is and at the moment use the feature/xorg branch)
docker run -it --rm \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
  -v ~/.config/emacs:/home/tsb/.config/emacs \
  -v ~/your-projects:/home/tsb/projects \
  emacs-gui- EMACS_CONTAINER=1- Set automatically to indicate container environment
- Mount your Emacs configuration to /home/tsb/.config/emacs
GPG is pre-configured with allow-loopback-pinentry for container compatibility. Your GPG keys can be mounted if needed.
To match your host user ID:
podman build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) -t emacs-gui .| Category | Packages | 
|---|---|
| Core | emacs-pgtk-nativecomp, dbus, wayland-libs | 
| Development | build-base, git, ripgrep, fd, curl, wget | 
| Fonts | font-jetbrains-mono-nerd, ttf-dejavu, font-noto-emoji | 
| Spell Check | aspell-en, hunspell-en | 
| Security | gnupg, pinentry | 
| Themes | adwaita-icon-theme, breeze-cursors | 
- Ensure $WAYLAND_DISPLAYor$DISPLAYis properly set
- Verify XDG_RUNTIME_DIR socket mounting for Wayland
- Container includes common fonts; mount additional fonts if needed:
    -v ~/.local/share/fonts:/home/tsb/.local/share/fonts:ro
- Native compilation cache persists in your mounted .config/emacsdirectory
- First run may be slower as packages compile