Difference between revisions of "Docker"

From WikEmacs
Jump to navigation Jump to search
(docker utils)
 
 
(2 intermediate revisions by 2 users not shown)
Line 9: Line 9:
 
= Manipulating images and containers =
 
= Manipulating images and containers =
  
For that you'll want [https://github.com/Silex/docker.el docker.el] (in MELPA too). It defines a docker-images major mode to manipulate docker images: call it with '''M-x docker-images''' and use the keys: '''D'''elete, '''F'''etch (pull), '''R'''un, '''P'''ush and the same with containers.
+
For that you'll want [https://github.com/Silex/docker.el docker.el] (in MELPA too). It defines a docker-images major mode to manipulate docker images: call it with '''M-x docker-images'''. You can first select images you want to work on with keys similar to [[Dired]]:
 +
 
 +
* '''m'''ark,
 +
* '''u'''nmark,
 +
* '''t'''oggle marks,
 +
* '''U'''nmark all.
 +
 
 +
Then you can apply actions on them:
 +
 
 +
* '''D'''elete,  
 +
* '''F'''etch (pull),  
 +
* '''R'''un,  
 +
* '''P'''ush  
 +
 
 +
When you press one of these keys you'll be presented with an interactive interface à la [[Magit]].
 +
 
 +
It works the same for containers: '''M-x docker-containers''', see the documentation.
 +
 
 +
We can also manipulate images and containers programmatically with [https://github.com/Silex/docker.el#api the functions provided that form an API].
 +
 
 +
 
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Latest revision as of 14:35, 29 June 2015


In the emacs world we have some packages to work with Docker.

Syntax highlighting

This is possible with dockerfile-mode (in MELPA). It also offers the ability to build the image directly (C-c C-b) from the buffer.

Manipulating images and containers

For that you'll want docker.el (in MELPA too). It defines a docker-images major mode to manipulate docker images: call it with M-x docker-images. You can first select images you want to work on with keys similar to Dired:

  • mark,
  • unmark,
  • toggle marks,
  • Unmark all.

Then you can apply actions on them:

  • Delete,
  • Fetch (pull),
  • Run,
  • Push

When you press one of these keys you'll be presented with an interactive interface à la Magit.

It works the same for containers: M-x docker-containers, see the documentation.

We can also manipulate images and containers programmatically with the functions provided that form an API.