Need help with docker.el?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Silex
514 Stars 55 Forks 303 Commits 12 Opened issues

Description

Manage docker from Emacs.

Services available

!
?

Need anything else?

Contributors list

# 37,394
Ruby
emacs-l...
keymap
openvpn...
211 commits
# 200,485
Ruby
mapkit
googlem...
slack
17 commits
# 26,787
C
scikit-...
Electro...
ml
4 commits
# 151,727
Clojure...
Clojure
C++
Emacs
3 commits
# 170,523
C++
C
Three.j...
fiber
2 commits
# 276,953
emacs-l...
Algolia
Clojure
error-m...
2 commits
# 570,275
Emacs
Docker
2 commits
# 135,021
Common ...
Ada
Emacs
emacs-l...
1 commit
# 87,159
PHP
HTML
MongoDB
web-app...
1 commit
# 27,831
emacs-l...
melpa
elisp
zsh-com...
1 commit
# 194,894
HTML
Emacs
emacs-l...
emacs-c...
1 commit
# 603,457
Emacs
Docker
1 commit
# 143,945
pattern...
ui-libr...
Emacs
emacs-l...
1 commit
# 291,335
Clojure
webfram...
Emacs
emacs-l...
1 commit
# 610,297
Ruby
JavaScr...
Rails
timeago
1 commit
# 192,191
postcss
HTML
CSS
Emacs
1 commit
# 98,713
Go
HTML
echo
Git
1 commit
# 301,580
Emacs
Docker
1 commit
# 600,799
CSS
Erlang
Emacs
Docker
1 commit
# 627,088
Emacs
Docker
1 commit

MELPA MELPA Stable

docker.el

Emacs integration for Docker!

Supports docker containers, images, volumes, networks, docker-machine and docker-compose.

Screenshots

List images

Images list

Image run

Image run

Installation

The recommended way to install docker.el is through MELPA.

Here is a example use-package configuration:

(use-package docker
  :ensure t
  :bind ("C-c d" . docker))

Quickstart

Use M-x docker, select a resource then 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-machine: create, env, restart, rm, start, stop
  • docker-compose: build, config, create, down, exec, logs, pull, push, remove, restart, run, start, stop, up

You can also enter

dired
or open a file inside a container or volume.

Customizations

Thanks to 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-container-default-sort-key | Sort key for docker containers |
("Image")
| | docker-container-shell-file-name | Shell to use when entering containers |
/bin/sh
| | docker-image-default-sort-key | Sort key for docker images |
("Repository")
| | docker-machine-default-sort-key | Sort key for docker machines |
("Name")
| | docker-network-default-sort-key | Sort key for docker networks |
("Name")
| | docker-run-as-root | Run docker as root |
nil
| | docker-volume-default-sort-key | Sort key for docker volumes |
("Driver")
| | docker-run-default-args | Base arguments to use for docker run |
("-i" "-t" "--rm")
|

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
:
(add-to-list
   'docker-image-run-custom-args
   `("^postgres" ("-e POSTGRES_PASSWORD=postgres" . ,docker-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-run-default-args
.

FAQ

How to use docker-machine under OSX / MacOS?

The following configuration is required (some of it can probably be simplified by using https://github.com/purcell/exec-path-from-shell).

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))
;; Use "docker-machine env box" command to find out your environment variables
(setenv "DOCKER_TLS_VERIFY" "1")
(setenv "DOCKER_HOST" "tcp://10.11.12.13:2376")
(setenv "DOCKER_CERT_PATH" "/Users/foo/.docker/machine/machines/box")
(setenv "DOCKER_MACHINE_NAME" "box")

This is necessary and useful if you use

docker-machine
. Notice though that there is also a native MacOS Docker implementation (now called Docker Desktop) which does not depend on VirtualBox and which does not require these tweaks.

Contributions

They are very welcome, either as suggestions or as pull requests by opening tickets on the issue tracker.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.