Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silex/docker.el
Manage docker from Emacs.
https://github.com/silex/docker.el
docker emacs
Last synced: 24 days ago
JSON representation
Manage docker from Emacs.
- Host: GitHub
- URL: https://github.com/silex/docker.el
- Owner: Silex
- Created: 2015-05-18T19:00:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T13:55:59.000Z (about 2 months ago)
- Last Synced: 2024-09-18T14:35:04.367Z (about 2 months ago)
- Topics: docker, emacs
- Language: Emacs Lisp
- Homepage:
- Size: 739 KB
- Stars: 738
- Watchers: 23
- Forks: 74
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[![MELPA](http://melpa.org/packages/docker-badge.svg)](http://melpa.org/#/docker)
[![MELPA Stable](http://stable.melpa.org/packages/docker-badge.svg)](http://stable.melpa.org/#/docker)
![CI status](https://github.com/Silex/docker.el/actions/workflows/ci.yml/badge.svg)# docker.el
Emacs integration for [Docker](https://www.docker.com)!
Supports docker containers, images, volumes, networks, contexts and docker-compose.
## Screenshots
### List images
![Images list](screenshots/image-ls.png)
### Image run
![Image run](screenshots/image-run.png)
## Installation
The recommended way to install docker.el is through [MELPA](https://github.com/milkypostman/melpa).
Here is a example [use-package](https://github.com/jwiegley/use-package) configuration:
``` elisp
(use-package docker
:ensure t
:bind ("C-c d" . docker))
```## Quickstart
Use M-x docker, select a resource then mark or unmark items using the following keybindings (for more
marking possibilities, check out https://github.com/politza/tablist):| Binding | Description |
|--------------------|----------------------|
| ? | List actions |
| l | Configure listing |
| m | Mark item |
| u | Unmark item |
| t | Toggle marks |
| U | Unmark all |
| s | Sort |
| * r | Mark items by regexp |
| < | Shrink column |
| > | Enlarge column |
| C-c C-e | Export to csv |Then select an action and follow the instructions.
## Supported commands
- docker container: attach, cp, diff, inspect, kill, logs, pause, rename, restart, rm, start, stop, unpause
- docker image: inspect, pull, push, rm, run, tag
- docker network: rm
- docker volume: rm
- docker context: ls, use
- docker-compose: build, config, create, down, exec, logs, pause, pull, push, remove, restart, run, start, stop, unpause, upYou can also enter `dired` or open a file inside a container or volume.
## Customizations
Thanks to [transient](https://github.com/magit/transient), all the transients arguments can be set temporarily or
permanently. See https://magit.vc/manual/transient/Saving-Values.html#Saving-Values for more information.There are also hidden items (e.g on `M-x docker` where you could specify the host or TLS settings), see
https://magit.vc/manual/transient/Enabling-and-Disabling-Suffixes.html for more information.Here is a list of other customizations you can set:
| Variable | Description | Default |
|---------------------------------------|--------------------------------------------|----------------------|
| docker-command | The docker binary to use | `docker` |
| docker-compose-command | The docker-compose binary to use | `docker-compose` |
| docker-container-columns | Columns definition for containers | `/bin/sh` |
| docker-container-default-sort-key | Sort key for containers | `("Image")` |
| docker-container-shell-file-name | Shell to use when entering containers | `/bin/sh` |
| docker-image-columns | Columns definition for images | Too complex to show |
| docker-image-default-sort-key | Sort key for images | `("Repository")` |
| docker-image-run-default-args | Base arguments to use for docker run | `("-i" "-t" "--rm")` |
| docker-network-columns | Columns definition for networks | Too complex to show |
| docker-network-default-sort-key | Sort key for networks | `("Name")` |
| docker-pop-to-buffer-action | Action for `docker-utils-pop-to-buffer` | `nil` |
| docker-run-as-root | Runs docker as root when enabled | `nil` |
| docker-run-async-with-buffer-function | Function used to run programs with buffers | Too complex to show |
| docker-show-messages | If non-nil message docker commands | `t` |
| docker-show-status | If non-nil compute status | `t` |
| docker-volume-columns | Columns definition for volumes | Too complex to show |
| docker-volume-default-sort-key | Sort key for volumes | `("Driver")` |### Changing the default arguments for `docker run`
You can match on the repository name for an image to customize the initial infix arguments via `docker-image-run-custom-args`:
```elisp
(add-to-list
'docker-image-run-custom-args
`("^postgres" ("-e POSTGRES_PASSWORD=postgres" . ,docker-image-run-default-args)))
```So when `docker run` is called on an image whose repository name matches the regular expression `^postgres`, the option
`"-e POSTGRES_PASSWORD=postgres"` will appear as set along with the defaults specified by `docker-image-run-default-args`.## Vterm support
If [vterm](https://github.com/akermu/emacs-libvterm) is installed, it'll be used for any commands that needs a running
buffer (for example `docker run`, `docker logs`, etc).## Contributions
They are very welcome, either as suggestions or as pull requests by opening tickets
on the [issue tracker](https://github.com/Silex/docker.el/issues).