An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

[![Docker Container Image Size](https://shields.beevelop.com/docker/image/image-size/cjimti/emacs/latest.svg)](https://hub.docker.com/r/cjimti/emacs/)
[![Docker Container Layers](https://shields.beevelop.com/docker/image/layers/cjimti/emacs/latest.svg)](https://hub.docker.com/r/cjimti/emacs/)
[![Docker Container Pulls](https://img.shields.io/docker/pulls/cjimti/emacs.svg)](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
```