-
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 yourenv
: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
andGID
- transparent permissionsUNAME
andGNAME
- user & group name in containerHOME
- rewrite home path for new userWORKSPACE
- mount path from hostSHELL
- default shellTERM
- set terminal envORG_FILES
- only relative pathHOST_USER
,HOST_IP
,HOST_PORT
- remote management through sshDISPLAY
- for GUI applicationWEB_BROWSER
- setup browser for emacsREPOSITORY
- our repository dotemacs (first clone)
-
Setup ssh daemon and restart
# /etc/ssh/sshd_config ListenAddress 127.1
-
Run and wait until the boot:
$ dockemacs
-
;; .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"))))))