/dockemacs

My dockerized emacs ...

Primary LanguageEmacs Lisp

Dockemacs - the minimal emacs noX

Coverage Status Build Status Latest Version Image size / layers Docker Pulls Docker Stars

Dockemacs

Installation

  • Install Docker Engine:

  • Create emacs data volume:

    docker volume create emacs_data
  • Add alias or script file:

    alias dockemacs='
    docker run -it --rm --net=host \
         --env-file $HOME/.dockemacs \
         --entrypoint initialize "$@" \
         -v $HOME:/mnt/workspace \
         -v emacs_data:/home/emacser/.emacs.d \
         -v /etc/localtime:/etc/localtime:ro \
         afsmnghr/dockemacs:1.5.2 startup
    '
  • Prepare $HOME/.dockemacs, check your env:

    echo "UID=$(id -u)" >> $HOME/.dockemacs
    echo "GID=$(id -g)" >> $HOME/.dockemacs
    echo "UNAME=emacser" >> $HOME/.dockemacs
    echo "GNAME=emacs" >> $HOME/.dockemacs
    echo "HOME=/home/emacser" >> $HOME/.dockemacs
    echo "WORKSPACE=/mnt/workspace" >> $HOME/.dockemacs
    echo "SHELL=/bin/bash" >> $HOME/.dockemacs
    echo "TERM=xterm-256color" >> $HOME/.dockemacs
    echo "ORG_FILES=Documents/org/" >> $HOME/.dockemacs
    echo "HOST_USER=afsmnghr" >> $HOME/.dockemacs
    echo "HOST_IP=127.1" >> $HOME/.dockemacs # only work with --net=host
    echo "HOST_PORT=22" >> $HOME/.dockemacs
    echo "DISPLAY=:0.0" >> $HOME/.dockemacs
    echo "WEB_BROWSER=chromium" >> $HOME/.dockemacs
    echo "REPOSITORY=git@github.com:AfsmNGhr/dockemacs.git" >> $HOME/.dockemacs
    • UID and GID - transparent permissions
    • UNAME and GNAME - user & group name in container
    • HOME - rewrite home path for new user
    • WORKSPACE - mount path from host
    • SHELL - default shell
    • TERM - set terminal env
    • ORG_FILES - only relative path
    • HOST_USER, HOST_IP, HOST_PORT - remote management through ssh
    • DISPLAY - for GUI application
    • WEB_BROWSER - setup browser for emacs
    • REPOSITORY - our repository dotemacs (first clone)
  • Setup ssh daemon and restart

    # /etc/ssh/sshd_config
    
    ListenAddress 127.1
  • Run and wait until the boot:

    $ dockemacs

Flycheck wrapped checkers

  • Rubocop:

    ;; .dir-locals.el
    
    ((nil . ((eval .
                 (progn
                   (setenv "PROJECT_LOCAL_PATH" "/mnt/workspace/local/path")
                   (setenv "PROJECT_REMOTE_PATH" "/remote/path")
                   (setenv "PROJECT_RUBOCOP_CMD" "docker exec -it `CONTAINER` bundle exec rubocop"))))))