see: https://mk.imti.co/dont-install-emacs/
I use this for servers with Docker but no emacs. The container works best and is most transparent when it mounts the user's home directory. Mounting a home directory requires a lot of trust in the container. So who am I? You probably want to build your container and lose the need to trust me on this one; it's up to you. Clone or fork github.com/cjimti/cmd-emacs, if you would like to create your own. You can also easily cut-and-paste the Dockerfile into your own.
See the Build Container section below to make your own.
Installing the container-as-command emacs is simply creating an alias by adding this line to your .bash_profile or .bashrc:
alias emacs='docker run --rm -it -v "$PWD":/src -v "$HOME":/root cjimti/emacs'
Open a new terminal and run:
alias emacs
Run emacs:
emacs
The files in your current directory mount to the path /src in the container.
Open a file in the new emacs/docker command:
emacs ./somefile.yml
docker run --rm -it -v "$(pwd)":/src --entrypoint sh cjimti/emacs
Change cjimti to your own Docker Hub username if you intend to push the container.
docker build -t cjimti/emacs .
docker push cjimti/emacs
Content type
Image
Digest
Size
47.1 MB
Last updated
over 8 years ago
docker pull cjimti/emacs