https://github.com/cjimti/cmd-emacs
Container-as-command: Emacs
https://github.com/cjimti/cmd-emacs
alpine docker docker-image editor emacs
Last synced: about 2 months ago
JSON representation
Container-as-command: Emacs
- Host: GitHub
- URL: https://github.com/cjimti/cmd-emacs
- Owner: cjimti
- License: mit
- Created: 2018-03-26T18:14:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-26T20:04:02.000Z (about 8 years ago)
- Last Synced: 2025-02-14T09:48:36.809Z (over 1 year ago)
- Topics: alpine, docker, docker-image, editor, emacs
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://hub.docker.com/r/cjimti/emacs/)
[](https://hub.docker.com/r/cjimti/emacs/)
[](https://hub.docker.com/r/cjimti/emacs/)
# Background
see: [https://mk.imti.co/dont-install-emacs/](https://mk.imti.co/dont-install-emacs/)
# Container-as-command: 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](https://github.com/cjimti/cmd-emacs), if you would like to create your own. You can also easily cut-and-paste the
[Dockerfile](https://github.com/cjimti/cmd-emacs/blob/master/Dockerfile) into your own.
See the **Build Container** section below to make your own.
## Install / Run Emacs
Installing the container-as-command emacs is simply creating an alias
by adding this line to your .bash_profile or .bashrc:
```bash
alias emacs='docker run --rm -it -v "$PWD":/src -v "$HOME":/root cjimti/emacs'
```
Open a new terminal and run:
```bash
alias emacs
```
Run emacs:
```bash
emacs
```
The files in your current directory mount to the path `/src` in the container.
Open a file in the new emacs/docker command:
```bash
emacs ./somefile.yml
```
## Debug
```bash
docker run --rm -it -v "$(pwd)":/src --entrypoint sh cjimti/emacs
```
## Build Container
Change **cjimti** to your own Docker Hub username if you intend to push the container.
#### Build:
```bash
docker build -t cjimti/emacs .
```
#### Push:
```bash
docker push cjimti/emacs
```