silex / docker.el Goto Github PK
View Code? Open in Web Editor NEWManage docker from Emacs.
Manage docker from Emacs.
Hi Docker.el developers,
I don't think this problem is directly related to Docker.el, but maybe you can give me some pointers as to how to solve it. The long and short of it is that when I start an Alpine container using ash, I get some stray escape sequences, even though my TERM
is set to dumb via -e
:
/ # �[6n
/ # �[6necho $TERM
echo $TERM
dumb
/ # �[6n
I've done some google searches but I just can't find a way to stop this. Note that if I run the docker command from a regular emacs shell I also see these stray sequences, which leads me to conclude this is a more general problem.
I've found a few random pages on similar topics, but nothing specific to this:
-t
command.-t
but does not quite explain how this links back to the ANSI escape issues.Any pointers etc are greatly appreciated.
Cheers
Marco
In docker-containers buffer, when trying to sort by creation date, Containers Menu mode (due to tablist mode, I believe) only sorts by lexicographical order, not by temporal order. For instance, "2 weeks ago" comes before "3 minutes ago", which comes before "7 weeks ago".
This is a bit frustrating as docker ps -a
from the command line sorts that way.
Thank you.
Description
On a new install, on macOS, running docker-containers fails with "Unrecognized keyword: template".
Reproduction
Observed behaviour
The container list is empty and messages shows:
docker ps --format="[{{.ID|json}},{{.Image|json}},{{.Command|json}},{{.RunningFor|json}},{{.Status|json}},{{.Ports|json}},{{.Names|json}}]" -a
Unrecognized keyword: "template"
Running the command in a clean terminal gives the output:
template: :1:6: executing "" at : wrong number of args for json: want 1 got 0
Expected behaviour
The list of containers are shown
Side note
Moving the json statement to the front of the field, and removing the pipe, outputs some json, ie. {{json .ID}}
System info
macOS Sierra 10.12.1
Emacs 25.1.1
Docker 1.13.0-rc4 (beta)
Is there any reason why the package is not using "lexical-binding: t" in their files? Apparently is a no brainer: http://nullprogram.com/blog/2016/12/22/
Your changes introduced this in the logs:
-*- mode: docker-logs; default-directory: "~/work/stvs/redmine/" -*-
docker logs started at Tue Apr 17 14:36:24
While searching alternatives I fell on auto-revert-tail-mode
instead of compilation-mode
. Can you give it a try and report?
This is harder than it looks, because of several issues:
Basically, an implementation using the API is not straighforward, and is likely to differ from the console experience. Magit's success is also because it stays close to the git console experience (e.g it calls "git foo" constantly).
Something that would open a dired with the volume's content.
We can maybe hack it somehow by changing the insert directory function to something like:
docker run --rm -v yarn_cache:/data busybox ls -alh /data
Maybe there are better options though.
After entered docker-machines
buffer, all keys like m
or O
are unusable.
Hey! First of all, thank you for this amazing package! It's incredibly useful 🙌
An issue I've had with this package is that it doesn't allow me to run two shells in the same container. When I run docker-containers
, and then press b
twice to get a shell, it always points me to the already opened shell in that container (if there is one). Is this feasible at all?
On my machine, I need run docker with root privileges. When I tried changing the docker-command
to sudo docker
, I just got no tty present and no askpass
.
Luckily, I was able to get it working using Advise:
(defadvice docker (around my-docker-sudo-fix (action &rest args))
(let ((default-directory "/sudo::"))
ad-do-it action args))
I haven't extensively tested this, and I didn't know if you'd want to add this to the package, or just put a note about it in the README, so I'm just submitting it as an issue.
I'm active user of nginx-proxy container https://github.com/jwilder/nginx-proxy, so I usually do not specify ports for containers. I use VIRTUAL_HOST=my.host environment variables instead.
It seems container names does not look properly in docker-containers buffer, when ports does not specified for container.
My screenshot:
https://www.dropbox.com/s/ap2ea1k5ynw9zob/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202016-01-06%2016.07.52.png?dl=0
I like that this package follows magit in terms of the popups.
I am curious whether others would find more general dispatch popups valuable?
Following magit, a single global keybinding could open a general dispatch popup with shortcuts to all of the current docker-global-mode functions (containers, images, etc). When inside of any of the docker buffers in addition to keybindings for each popup, a general dispatch popup could be used to display shortcuts to the other popups.
For example, a docker-dispatch-popup to display shortcuts for the global functions: docker-containers, docker-images, etc. Inside of the docker-containers buffer, ?
could trigger a docker-containers-popup which displays keybindings for the specific buffer, such as docker-containers-find-file-popup.
The docker-20180710.1443 works fine in my emacs. However, after upgrading to latest docker-20180728.1948, I always get the following error:
Debugger entered--Lisp error: (void-function magit-define-popup)
(magit-define-popup docker "Popup for docker." 'docker :man-page "docker" :options '((72 "Host" "--host ")) :actions (cons "Docker" (cons (list 99 "Containers" (docker-utils-set-then-call 'docker-arguments 'docker-containers)) (cons (list 105 "Images" (docker-utils-set-then-call 'docker-arguments 'docker-images)) (cons (list 110 "Networks" (docker-utils-set-then-call 'docker-arguments 'docker-networks)) (cons (list 118 "Volumes" (docker-utils-set-then-call 'docker-arguments 'docker-volumes)) '("Other" (77 "Machines" docker-machines))))))))
eval-buffer(#<buffer *load*> nil "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads.el" nil t) ; Reading at buffer position 786
load-with-code-conversion("/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads.el" "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads.el" nil t)
#<subr load>("/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads" nil t nil nil)
ad-Advice-load(#<subr load> "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads" nil t)
apply(ad-Advice-load #<subr load> ("/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads" nil t))
load("/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948/docker-autoloads" nil t)
package--activate-autoloads-and-load-path(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind nil :archive nil :dir "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948" :extras ((:url . "https://github.com/Silex/docker.el") (:maintainer "Philippe Vaucher" . "[email protected]") (:authors ("Philippe Vaucher" . "[email protected]")) (:keywords "filename" "convenience")) :signed nil))
package--load-files-for-activation(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind nil :archive nil :dir "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948" :extras ((:url . "https://github.com/Silex/docker.el") (:maintainer "Philippe Vaucher" . "[email protected]") (:authors ("Philippe Vaucher" . "[email protected]")) (:keywords "filename" "convenience")) :signed nil) :reload)
package-activate-1(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind nil :archive nil :dir "/home/haifeng/.emacs.d/elpa-26.1/docker-20180728.1948" :extras ((:url . "https://github.com/Silex/docker.el") (:maintainer "Philippe Vaucher" . "[email protected]") (:authors ("Philippe Vaucher" . "[email protected]")) (:keywords "filename" "convenience")) :signed nil) :reload :deps)
package-unpack(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil))
#f(compiled-function (&optional good-sigs) #<bytecode 0xfee48d>)(nil)
package--check-signature("https://melpa.org/packages/" "docker-20180728.1948.tar" "docker-20180728.1948/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0000755\0\ 0000000\0\ 0000000\0\ 00000000000\0\ 13327220317\0\ 012340\0 5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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0ustar \0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0(define-package \"docker\" \"20180728.1948\" \"Emacs interface to Docker\"\n '((emacs \"24.5\")\n (dash \"2.14.1\")\n (docker-tramp \"0.1\")\n (magit-popup \"2.12.3\")\n (s \"1.12.0\")\n (tablist \"0.70\")\n (json-mode \"1.7.0\"))\n :keywords\n '(\"filename\" \"convenience\")\n :authors\n '((\"Philippe Vaucher\" . \"[email protected]\"))\n :maintainer\n '(\"Philippe Vaucher\" . \"[email protected]\")\n :url \"https://github.com/Silex/docker.el\")\n;; Local Variables:\n;; no-byte-compile: t\n;; End:\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ docker-20180728.1948/docker-image.el\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0000644\0\ 0000000\0\ 0000000\0\ 00000023020\0\ 13327220317\0\ 015206\0 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ustar \0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-image.el --- Emacs interface to docker-image -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'docker)\n(require 'docker-utils)\n(require 'magit-popup)\n(require 'tablist)\n\n(defgroup docker-image nil\n \"Docker images customization group.\"\n :group 'docker)\n\n(defcustom docker-image-default-sort-key '(\"Repository\" . nil)\n \"Sort key for docker images.\n\nThis should be a cons cell (NAME . FLIP) where\nNAME is a string matching one of the column names\nand FLIP is a boolean to specify the sort order.\"\n :group 'docker-image\n :type '(cons (choice (const \"Repository\")\n (const \"Tag\")\n (const \"Id\")\n (const \"Created\")\n (const \"Size\"))\n (choice (const :tag \"Ascending\" nil)\n (const :tag \"Descending\" t))))\n\n(defcustom docker-image-run-arguments '(\"-i\" \"-t\" \"--rm\")\n \"Default arguments for `docker-image-run-popup'.\"\n :group 'docker-image\n :type 'list)\n\n(defun docker-image-parse (line)\n \"Convert a LINE from \\\"docker images\\\" to a `tabulated-list-entries' entry.\"\n (let* ((data (s-split \"\\t\" line))\n (name (format \"%s:%s\" (nth 0 data) (nth 1 data))))\n (setf (nth 3 data) (format-time-string \"%F %T\" (date-to-time (nth 3 data))))\n (list\n (if (s-contains? \"<none>\" name) (nth 2 data) name)\n (apply #'vector data))))\n\n(defun docker-image-entries ()\n \"Return the docker images data for `tabulated-list-entries'.\"\n (let* ((fmt \"{{.Repository}}\\\\t{{.Tag}}\\\\t{{.ID}}\\\\t{{.CreatedAt}}\\\\t{{.Size}}\")\n (data (docker-run \"images\" (format \"--format=\\\"%s\\\"\" fmt)))\n (lines (s-split \"\\n\" data t)))\n (-map #'docker-image-parse lines)))\n\n(defun docker-image-refresh ()\n \"Refresh the images list.\"\n (setq tabulated-list-entries (docker-image-entries)))\n\n(defun docker-image-read-name ()\n \"Read an image name.\"\n (completing-read \"Image: \" (-map #'car (docker-image-entries))))\n\n(defun docker-image-sort-size (a-line b-line)\n \"Sort A-LINE and B-LINE by size.\"\n (let* ((sizes `(\"B\" 1 \"KB\" 1024 \"MB\" ,(expt 1024 2) \"GB\" ,(expt 1024 3) \"TB\" ,(expt 1024 4)))\n (a-size (elt (cadr a-line) 4))\n (b-size (elt (cadr b-line) 4))\n (a-parts (s-match \"^\\\\([0-9\\\\.]+\\\\)\\\\([A-Z]+\\\\)$\" a-size))\n (b-parts (s-match \"^\\\\([0-9\\\\.]+\\\\)\\\\([A-Z]+\\\\)$\" b-size))\n (a-value (string-to-number (-second-item a-parts)))\n (b-value (string-to-number (-second-item b-parts)))\n (a-multiplier (lax-plist-get sizes (-third-item a-parts)))\n (b-multiplier (lax-plist-get sizes (-third-item b-parts)))\n (a-bytes (* a-value a-multiplier))\n (b-bytes (* b-value b-multiplier)))\n (< a-bytes b-bytes)))\n\n;;;###autoload\n(defun docker-pull (name &optional all)\n \"Pull the image named NAME. If ALL is set, use \\\"-a\\\".\"\n (interactive (list (docker-image-read-name) current-prefix-arg))\n (docker-run \"pull\" (when all \"-a \") name))\n\n;;;###autoload\n(defun docker-push (name)\n \"Push the image named NAME.\"\n (interactive (list (docker-image-read-name)))\n (docker-run \"push\" name))\n\n;;;###autoload\n(defun docker-rmi (name &optional force no-prune)\n \"Destroy or untag the image named NAME.\n\nForce removal of the image when FORCE is set.\nDo not delete untagged parents when NO-PRUNE is set.\"\n (interactive (list (docker-image-read-name) current-prefix-arg))\n (docker-run \"rmi\" (when force \"-f\") (when no-prune \"--no-prune\") name))\n\n;;;###autoload\n(defun docker-tag (image name)\n \"Tag IMAGE using NAME.\"\n (interactive (list (docker-image-read-name) (read-string \"Name: \")))\n (docker-run \"tag\" image name))\n\n(defun docker-image-rm-selection ()\n \"Run \\\"docker rmi\\\" on the images selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"rmi\" (docker-image-rm-arguments) it))\n (tablist-revert))\n\n(defun docker-image-pull-selection ()\n \"Run \\\"docker pull\\\" on the images selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"pull\" (docker-image-pull-arguments) it))\n (tablist-revert))\n\n(defun docker-image-push-selection ()\n \"Run \\\"docker push\\\" on the images selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"push\" (docker-image-push-arguments) it)))\n\n(defun docker-image-run-selection (command)\n \"Run \\\"docker run\\\" on the images selection.\"\n (interactive \"sCommand: \")\n (let ((default-directory (if (and docker-run-as-root\n (not (file-remote-p default-directory)))\n \"/sudo::\"\n default-directory)))\n (--each (docker-utils-get-marked-items-ids)\n (async-shell-command\n (format \"%s run %s %s %s\" docker-command (s-join \" \" (docker-image-run-arguments)) it command)\n (format \"*run %s*\" it)))))\n\n(defun docker-image-inspect-selection ()\n \"Run \\\"docker inspect\\\" on the images selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-utils-with-buffer (format \"inspect %s\" it)\n (insert (docker-run \"inspect\" (docker-image-inspect-arguments) it))\n (json-mode))))\n\n(defun docker-image-tag-selection ()\n \"Tag images.\"\n (interactive)\n (docker-utils-select-if-empty)\n (--each (docker-utils-get-marked-items-ids)\n (docker-tag it (read-string (format \"Tag for %s: \" it))))\n (tablist-revert))\n\n(magit-define-popup docker-image-rm-popup\n \"Popup for removing images.\"\n 'docker-image\n :man-page \"docker-rmi\"\n :switches '((?f \"Force\" \"-f\")\n (?n \"Don't prune\" \"--no-prune\"))\n :actions '((?D \"Remove\" docker-image-rm-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-image-pull-popup\n \"Popup for pulling images.\"\n 'docker-image\n :man-page \"docker-pull\"\n :switches '((?a \"All\" \"-a\"))\n :actions '((?F \"Pull\" docker-image-pull-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-image-push-popup\n \"Popup for pushing images.\"\n 'docker-image\n :man-page \"docker-push\"\n :actions '((?P \"Push\" docker-image-push-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-image-inspect-popup\n \"Popup for inspecting images.\"\n 'docker-image\n :man-page \"docker-inspect\"\n :actions '((?I \"Inspect\" docker-image-inspect-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-image-run-popup\n \"Popup for running images.\"\n 'docker-image\n :man-page \"docker-run\"\n :switches '((?d \"Daemonize\" \"-d\")\n (?i \"Interactive\" \"-i\")\n (?t \"TTY\" \"-t\")\n (?r \"Remove\" \"--rm\")\n (?p \"Privileged\" \"--privileged\")\n (?o \"Read only\" \"--read-only\")\n (?T \"Synchronize time\" \"-v /etc/localtime:/etc/localtime:ro\")\n (?W \"Web ports\" \"-p 80:80 -p 443:443 -p 8080:8080\")\n (?D \"With display\" \"-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY\"))\n :options '((?v \"volume\" \"-v \")\n (?m \"name\" \"--name \")\n (?e \"environment\" \"-e \")\n (?p \"port\" \"-p \")\n (?w \"workdir\" \"-w \")\n (?u \"user\" \"-u \")\n (?n \"entrypoint\" \"--entrypoint \"))\n :actions '((?R \"Run images\" docker-image-run-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-image-help-popup\n \"Help popup for docker images.\"\n 'docker-image\n :actions '(\"Docker images help\"\n (?D \"Remove\" docker-image-rm-popup)\n (?F \"Pull\" docker-image-pull-popup)\n (?I \"Inspect\" docker-image-inspect-popup)\n (?P \"Push\" docker-image-push-popup)\n (?R \"Run\" docker-image-run-popup)\n (?T \"Tag\" docker-image-tag-selection)))\n\n(defvar docker-image-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"?\" 'docker-image-help-popup)\n (define-key map \"D\" 'docker-image-rm-popup)\n (define-key map \"F\" 'docker-image-pull-popup)\n (define-key map \"I\" 'docker-image-inspect-popup)\n (define-key map \"P\" 'docker-image-push-popup)\n (define-key map \"R\" 'docker-image-run-popup)\n (define-key map \"T\" 'docker-image-tag-selection)\n map)\n \"Keymap for `docker-image-mode'.\")\n\n;;;###autoload\n(defun docker-images ()\n \"List docker images.\"\n (interactive)\n (docker-utils-pop-to-buffer \"*docker-images*\")\n (docker-image-mode)\n (tablist-revert))\n\n(define-derived-mode docker-image-mode tabulated-list-mode \"Images Menu\"\n \"Major mode for handling a list of docker images.\"\n (setq tabulated-list-format [(\"Repository\" 30 t)(\"Tag\" 20 t)(\"Id\" 16 t)(\"Created\" 23 t)(\"Size\" 10 docker-image-sort-size)])\n (setq tabulated-list-padding 2)\n (setq tabulated-list-sort-key docker-image-default-sort-key)\n (add-hook 'tabulated-list-revert-hook 'docker-image-refresh nil t)\n (tabulated-list-init-header)\n (tablist-minor-mode))\n\n(provide 'docker-image)\n\n;;; docker-image.el ends here\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-container.el --- Emacs interface to docker-container -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n;; Yuki Inoue <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'docker)\n(require 'docker-utils)\n(require 'magit-popup)\n(require 'tablist)\n(require 'json)\n\n(defgroup docker-container nil\n \"Docker container customization group.\"\n :group 'docker)\n\n(defcustom docker-container-show-all t\n \"Show non-running containers.\"\n :group 'docker\n :type 'boolean)\n\n(defcustom docker-container-shell-file-name shell-file-name\n \"Shell to use when entering containers.\nFor more information see the variable `shell-file-name'.\"\n :group 'docker-container\n :type 'string)\n\n(defcustom docker-container-default-sort-key '(\"Image\" . nil)\n \"Sort key for docker containers.\n\nThis should be a cons cell (NAME . FLIP) where\nNAME is a string matching one of the column names\nand FLIP is a boolean to specify the sort order.\"\n :group 'docker-container\n :type '(cons (choice (const \"Id\")\n (const \"Image\")\n (const \"Command\")\n (const \"Created\")\n (const \"Status\")\n (const \"Ports\")\n (const \"Names\"))\n (choice (const :tag \"Ascending\" nil)\n (const :tag \"Descending\" t))))\n\n(defun docker-container-parse (line)\n \"Convert a LINE from \\\"docker ps\\\" to a `tabulated-list-entries' entry.\"\n (let (data)\n (condition-case nil\n (setq data (json-read-from-string line))\n (json-readtable-error\n (error \"Could not read following string as json:\\n%s\" line)))\n (setf (aref data 3) (format-time-string \"%F %T\" (date-to-time (aref data 3))))\n (list (aref data 6) data)))\n\n(defun docker-container-entries ()\n \"Return the docker containers data for `tabulated-list-entries'.\"\n (let* ((fmt \"[{{json .ID}},{{json .Image}},{{json .Command}},{{json .CreatedAt}},{{json .Status}},{{json .Ports}},{{json .Names}}]\")\n (data (docker-run \"ps\" (format \"--format=\\\"%s\\\"\" fmt) (when docker-container-show-all \"-a \")))\n (lines (s-split \"\\n\" data t)))\n (-map #'docker-container-parse lines)))\n\n(defun docker-container-refresh ()\n \"Refresh the containers list.\"\n (setq tabulated-list-entries (docker-container-entries)))\n\n(defun docker-container-read-name ()\n \"Read an container name.\"\n (completing-read \"Container: \" (-map #'car (docker-container-entries))))\n\n;;;###autoload\n(defun docker-start (name)\n \"Start the container named NAME.\"\n (interactive (list (docker-container-read-name)))\n (docker-run \"start\" name))\n\n;;;###autoload\n(defun docker-stop (name &optional timeout)\n \"Stop the container named NAME.\n\nTIMEOUT is the number of seconds to wait for the container to stop before killing it.\"\n (interactive (list (docker-container-read-name) current-prefix-arg))\n (docker-run \"stop\" (when timeout (format \"-t %d\" timeout)) name))\n\n;;;###autoload\n(defun docker-restart (name &optional timeout)\n \"Restart the container named NAME.\n\nTIMEOUT is the number of seconds to wait for the container to stop before killing it.\"\n (interactive (list (docker-container-read-name) current-prefix-arg))\n (docker-run \"restart\" (when timeout (format \"-t %d\" timeout)) name))\n\n;;;###autoload\n(defun docker-pause (name)\n \"Pause the container named NAME.\"\n (interactive (list (docker-container-read-name)))\n (docker-run \"pause\" name))\n\n;;;###autoload\n(defun docker-unpause (name)\n \"Unpause the container named NAME.\"\n (interactive (list (docker-container-read-name)))\n (docker-run \"unpause\" name))\n\n;;;###autoload\n(defun docker-rm (name &optional force link volumes)\n \"Remove the container named NAME.\n\nWith prefix argument, sets FORCE to true.\n\nForce the removal even if the container is running when FORCE is set.\nRemove the specified link and not the underlying container when LINK is set.\nRemove the volumes associated with the container when VOLUMES is set.\"\n (interactive (list (docker-container-read-name) current-prefix-arg))\n (docker-run \"rm\" (when force \"-f\") (when link \"-l\") (when volumes \"-v\") name))\n\n;;;###autoload\n(defun docker-kill (name &optional signal)\n \"Kill the container named NAME using SIGNAL.\"\n (interactive (list (docker-container-read-name)))\n (docker-run \"kill\" (when signal (format \"-s %s\" signal)) name))\n\n;;;###autoload\n(defun docker-inspect (name)\n \"Inspect the container named NAME.\"\n (interactive (list (docker-container-read-name)))\n (docker-utils-with-buffer (format \"inspect %s\" name)\n (insert (docker-run \"inspect\" name))\n (json-mode)))\n\n;;;###autoload\n(defun docker-diff (name)\n \"Diff the container named NAME.\"\n (interactive (list (docker-container-read-name)))\n (docker-utils-with-buffer (format \"diff %s\" name)\n (insert (docker-run \"diff\" name))))\n\n;;;###autoload\n(defun docker-rename (container name)\n \"Rename CONTAINER using NAME.\"\n (interactive (list (docker-container-read-name) (read-string \"Name: \")))\n (docker-run \"rename\" container name))\n\n;;;###autoload\n(defun docker-logs (name &optional follow)\n \"Show the logs from container NAME.\n\nIf FOLLOW is set, run in `async-shell-command'.\"\n (interactive (list (docker-container-read-name)))\n (if follow\n (async-shell-command (format \"%s logs -f %s\" docker-command name) (format \"* docker logs %s *\" name))\n (docker-utils-with-buffer (format \"logs %s\" name)\n (insert (docker-run \"logs\" name)))))\n\n;;;###autoload\n(defun docker-container-find-file (container file)\n \"Inside CONTAINER open FILE.\"\n (interactive\n (let* ((container-name (docker-container-read-name))\n (tramp-filename (read-file-name \"File: \" (format \"/docker:%s:/\" container-name))))\n (with-parsed-tramp-file-name tramp-filename nil\n (list host localname))))\n (find-file (format \"/docker:%s:%s\" container file)))\n\n;;;###autoload\n(defun docker-container-find-directory (container directory)\n \"Inside CONTAINER open DIRECTORY.\"\n (interactive\n (let* ((container-name (docker-container-read-name))\n (tramp-filename (read-directory-name \"Directory: \" (format \"/docker:%s:/\" container-name))))\n (with-parsed-tramp-file-name tramp-filename nil\n (list host localname))))\n (dired (format \"/docker:%s:%s\" container directory)))\n\n(defalias 'docker-container-dired 'docker-container-find-directory)\n\n;;;###autoload\n(defun docker-container-shell (container)\n \"Open `shell' in CONTAINER.\"\n (interactive (list (docker-container-read-name)))\n (let* ((shell-file-name docker-container-shell-file-name)\n (container-address (format \"docker:%s:/\" container))\n (file-prefix (if (file-remote-p default-directory)\n (with-parsed-tramp-file-name default-directory nil\n (format \"/%s:%s|\" method host))\n \"/\"))\n (default-directory (format \"%s%s\" file-prefix container-address)))\n (shell (format \"*shell %s*\" default-directory))))\n\n;;;###autoload\n(defun docker-container-eshell (container)\n \"Open `eshell' in CONTAINER.\"\n (interactive (list (docker-container-read-name)))\n (let* ((container-address (format \"docker:%s:/\" container))\n (file-prefix (if (file-remote-p default-directory)\n (with-parsed-tramp-file-name default-directory nil\n (format \"/%s:%s|\" method host))\n \"/\"))\n (default-directory (format \"%s%s\" file-prefix container-address))\n (eshell-buffer-name (format \"*eshell %s*\" default-directory)))\n (eshell)))\n\n(defun docker-container-start-selection ()\n \"Run `docker-start' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"start\" (docker-container-start-arguments) it))\n (tablist-revert))\n\n(defun docker-container-stop-selection ()\n \"Run `docker-stop' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"stop\" (docker-container-stop-arguments) it))\n (tablist-revert))\n\n(defun docker-container-restart-selection ()\n \"Run `docker-restart' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"restart\" (docker-container-restart-arguments) it))\n (tablist-revert))\n\n(defun docker-container-pause-selection ()\n \"Run `docker-pause' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"pause\" (docker-container-pause-arguments) it))\n (tablist-revert))\n\n(defun docker-container-unpause-selection ()\n \"Run `docker-unpause' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"unpause\" (docker-container-unpause-arguments) it))\n (tablist-revert))\n\n(defun docker-container-rm-selection ()\n \"Run `docker-rm' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"rm\" (docker-container-rm-arguments) it))\n (tablist-revert))\n\n(defun docker-container-kill-selection ()\n \"Run `docker-kill' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"kill\" (docker-container-kill-arguments) it))\n (tablist-revert))\n\n(defun docker-container-inspect-selection ()\n \"Run `docker-inspect' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-utils-with-buffer (format \"inspect %s\" it)\n (insert (docker-run \"inspect\" (docker-container-inspect-arguments) it))\n (json-mode))))\n\n(defun docker-container-diff-selection ()\n \"Run `docker-diff' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-utils-with-buffer (format \"diff %s\" it)\n (insert (docker-run \"diff\" (docker-container-diff-arguments) it)))))\n\n(defun docker-container-rename-selection ()\n \"Rename containers.\"\n (interactive)\n (docker-utils-select-if-empty)\n (--each (docker-utils-get-marked-items-ids)\n (docker-rename it (read-string (format \"New name for %s: \" it))))\n (tablist-revert))\n\n(defun docker-container-logs-selection ()\n \"Run \\\"docker logs\\\" on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (async-shell-command\n (format \"%s logs %s %s\" docker-command (s-join \" \" (docker-container-logs-arguments)) it)\n (format \"* docker logs %s *\" it))))\n\n(defun docker-container-find-file-selection (path)\n \"Run `docker-container-find-file' on the containers selection.\"\n (interactive \"sPath: \")\n (--each (docker-utils-get-marked-items-ids)\n (docker-container-find-file it path)))\n\n(defun docker-container-shell-selection ()\n \"Run `docker-container-shell' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-container-shell it)))\n\n(defun docker-container-eshell-selection ()\n \"Run `docker-container-eshell' on the containers selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-container-eshell it)))\n\n(defun docker-container-cp-from-selection (container-path host-path)\n \"Run \\\"docker cp\\\" from CONTAINER-PATH to HOST-PATH for selected container.\"\n (interactive \"sContainer path: \\nFHost path: \")\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"cp\" (concat it \":\" container-path) host-path)))\n\n(defun docker-container-cp-to-selection (host-path container-path)\n \"Run \\\"docker cp\\\" from HOST-PATH to CONTAINER-PATH for selected containers.\"\n (interactive \"fHost path: \\nsContainer path: \")\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"cp\" host-path (concat it \":\" container-path))))\n\n(magit-define-popup docker-container-start-popup\n \"Popup for starting containers.\"\n 'docker-container\n :man-page \"docker-start\"\n :actions '((?S \"Start\" docker-container-start-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-stop-popup\n \"Popup for stoping containers.\"\n 'docker-container\n :man-page \"docker-stop\"\n :options '((?t \"Timeout\" \"-t \"))\n :actions '((?O \"Stop\" docker-container-stop-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-restart-popup\n \"Popup for restarting containers.\"\n 'docker-container\n :man-page \"docker-restart\"\n :options '((?t \"Timeout\" \"-t \"))\n :actions '((?R \"Restart\" docker-container-restart-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-pause-popup\n \"Popup for pauseing containers.\"\n 'docker-container\n :man-page \"docker-pause\"\n :actions '((?P \"Pause\" docker-container-pause-selection)\n (?U \"Unpause\" docker-container-unpause-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-rm-popup\n \"Popup for removing containers.\"\n 'docker-container\n :man-page \"docker-rm\"\n :switches '((?f \"Force\" \"-f\")\n (?v \"Volumes\" \"-v\"))\n :actions '((?D \"Remove\" docker-container-rm-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-kill-popup\n \"Popup for kill signaling containers\"\n 'docker-container\n :man-page \"docker-kill\"\n :options '((?s \"Signal\" \"-s \"))\n :actions '((?K \"Kill\" docker-container-kill-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-inspect-popup\n \"Popup for inspecting containers.\"\n 'docker-container\n :man-page \"docker-inspect\"\n :actions '((?I \"Inspect\" docker-container-inspect-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-diff-popup\n \"Popup for showing containers diffs.\"\n 'docker-container\n :man-page \"docker-diff\"\n :actions '((?d \"Diff\" docker-container-diff-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-logs-popup\n \"Popup for showing containers logs.\"\n 'docker-container\n :man-page \"docker-logs\"\n :switches '((?f \"Follow\" \"-f\"))\n :actions '((?L \"Logs\" docker-container-logs-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-find-file-popup\n \"Popup for opening containers files.\"\n 'docker-container\n :actions '((?f \"Open file\" docker-container-find-file-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-shell-popup\n \"Popup for doing M-x `shell'/`eshell' to containers.\"\n 'docker-container\n :actions '((?b \"Shell\" docker-container-shell-selection)\n (?e \"Eshell\" docker-container-eshell-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-cp-popup\n \"Popup for copying files from/to containers.\"\n 'docker-container\n :man-page \"docker-cp\"\n :actions '((?F \"Copy From\" docker-container-cp-from-selection)\n (?T \"Copy To\" docker-container-cp-to-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-container-help-popup\n \"Help popup for docker containers.\"\n 'docker-container\n :actions '(\"Docker containers help\"\n (?C \"Copy\" docker-container-cp-popup)\n (?D \"Remove\" docker-container-rm-popup)\n (?I \"Inspect\" docker-container-inspect-popup)\n (?K \"Kill\" docker-container-kill-popup)\n (?L \"Logs\" docker-container-logs-popup)\n (?O \"Stop\" docker-container-stop-popup)\n (?P \"Pause\" docker-container-pause-popup)\n (?R \"Restart\" docker-container-restart-popup)\n (?S \"Start\" docker-container-start-popup)\n (?b \"Shell\" docker-container-shell-popup)\n (?d \"Diff\" docker-container-diff-popup)\n (?f \"Find file\" docker-container-find-file-popup)\n (?r \"Rename\" docker-container-rename-selection)))\n\n(defvar docker-container-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"?\" 'docker-container-help-popup)\n (define-key map \"C\" 'docker-container-cp-popup)\n (define-key map \"D\" 'docker-container-rm-popup)\n (define-key map \"I\" 'docker-container-inspect-popup)\n (define-key map \"K\" 'docker-container-kill-popup)\n (define-key map \"L\" 'docker-container-logs-popup)\n (define-key map \"O\" 'docker-container-stop-popup)\n (define-key map \"P\" 'docker-container-pause-popup)\n (define-key map \"R\" 'docker-container-restart-popup)\n (define-key map \"S\" 'docker-container-start-popup)\n (define-key map \"b\" 'docker-container-shell-popup)\n (define-key map \"d\" 'docker-container-diff-popup)\n (define-key map \"f\" 'docker-container-find-file-popup)\n (define-key map \"r\" 'docker-container-rename-selection)\n map)\n \"Keymap for `docker-container-mode'.\")\n\n;;;###autoload\n(defun docker-containers ()\n \"List docker containers.\"\n (interactive)\n (docker-utils-pop-to-buffer \"*docker-containers*\")\n (docker-container-mode)\n (tablist-revert))\n\n(define-derived-mode docker-container-mode tabulated-list-mode \"Containers Menu\"\n \"Major mode for handling a list of docker containers.\"\n (setq tabulated-list-format [(\"Id\" 16 t)(\"Image\" 15 t)(\"Command\" 30 t)(\"Created\" 23 t)(\"Status\" 20 t)(\"Ports\" 10 t)(\"Names\" 10 t)])\n (setq tabulated-list-padding 2)\n (setq tabulated-list-sort-key docker-container-default-sort-key)\n (add-hook 'tabulated-list-revert-hook 'docker-container-refresh nil t)\n (tabulated-list-init-header)\n (tablist-minor-mode))\n\n(provide 'docker-container)\n\n;;; docker-container.el ends here\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-volume.el --- Emacs interface to docker-volume -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'docker)\n(require 'docker-utils)\n(require 'magit-popup)\n(require 'tablist)\n\n(defgroup docker-volume nil\n \"Docker volume customization group.\"\n :group 'docker)\n\n(defun docker-volume-parse (line)\n \"Convert a LINE from \\\"docker volume ls\\\" to a `tabulated-list-entries' entry.\"\n (let ((data (s-split \" \\\\{3,15\\\\}\" line t)))\n (list (nth 1 data) (apply #'vector data))))\n\n(defun docker-volume-entries ()\n \"Return the docker volumes data for `tabulated-list-entries'.\"\n (let* ((data (docker-run \"volume\" \"ls\"))\n (lines (cdr (s-split \"\\n\" data t))))\n (-map #'docker-volume-parse lines)))\n\n(defun docker-volume-refresh ()\n \"Refresh the volumes list.\"\n (setq tabulated-list-entries (docker-volume-entries)))\n\n(defun docker-volume-read-name ()\n \"Read a volume name.\"\n (completing-read \"Volume: \" (-map #'car (docker-volume-entries))))\n\n;;;###autoload\n(defun docker-volume-rm (name)\n \"Destroy the volume named NAME.\"\n (interactive (list (docker-volume-read-name)))\n (docker-run \"volume rm\" name))\n\n;;;###autoload\n(defun docker-volume-dired (name)\n (interactive (list (docker-volume-read-name)))\n (let ((path (docker-run \"inspect\" \"-f\" \"\\\"{{ .Mountpoint }}\\\"\" name)))\n (dired (format \"/sudo::%s\" path))))\n\n(defun docker-volume-rm-selection ()\n \"Run \\\"docker volume rm\\\" on the volumes selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"volume rm\" it))\n (tablist-revert))\n\n(defun docker-volume-dired-selection ()\n \"Run `docker-volume-dired' on the volumes selection.\"\n (interactive)\n (docker-utils-select-if-empty)\n (--each (docker-utils-get-marked-items-ids)\n (docker-volume-dired it)))\n\n(magit-define-popup docker-volume-rm-popup\n \"Popup for removing volumes.\"\n 'docker-volume\n :man-page \"docker-volume-rm\"\n :actions '((?D \"Remove\" docker-volume-rm-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-volume-help-popup\n \"Help popup for docker volumes.\"\n 'docker-volume\n :actions '(\"Docker volumes help\"\n (?D \"Remove\" docker-volume-rm-popup)\n (?d \"dired\" docker-volume-dired-selection)))\n\n(defvar docker-volume-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"?\" 'docker-volume-help-popup)\n (define-key map \"D\" 'docker-volume-rm-popup)\n (define-key map \"d\" 'docker-volume-dired-selection)\n map)\n \"Keymap for `docker-volume-mode'.\")\n\n;;;###autoload\n(defun docker-volumes ()\n \"List docker volumes.\"\n (interactive)\n (docker-utils-pop-to-buffer \"*docker-volumes*\")\n (docker-volume-mode)\n (tablist-revert))\n\n(define-derived-mode docker-volume-mode tabulated-list-mode \"Volumes Menu\"\n \"Major mode for handling a list of docker volumes.\"\n (setq tabulated-list-format [(\"Driver\" 10 t)(\"Name\" 10 t)])\n (setq tabulated-list-padding 2)\n (setq tabulated-list-sort-key (cons \"Driver\" nil))\n (add-hook 'tabulated-list-revert-hook 'docker-volume-refresh nil t)\n (tabulated-list-init-header)\n (tablist-minor-mode))\n\n(provide 'docker-volume)\n\n;;; docker-volume.el ends here\n\0\0\0\0\0\0\0\0\0\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0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-network.el --- Emacs interface to docker-network -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'docker)\n(require 'docker-utils)\n(require 'magit-popup)\n(require 'tablist)\n\n(defgroup docker-network nil\n \"Docker network customization group.\"\n :group 'docker)\n\n(defun docker-network-parse (line)\n \"Convert a LINE from \\\"docker network ls\\\" to a `tabulated-list-entries' entry.\"\n (let ((data (s-split \" \\\\{3,\\\\}\" line t)))\n (list (nth 1 data) (apply #'vector data))))\n\n(defun docker-network-entries ()\n \"Return the docker networks data for `tabulated-list-entries'.\"\n (let* ((data (docker-run \"network\" \"ls\"))\n (lines (cdr (s-split \"\\n\" data t))))\n (-map #'docker-network-parse lines)))\n\n(defun docker-network-refresh ()\n \"Refresh the networks list.\"\n (setq tabulated-list-entries (docker-network-entries)))\n\n(defun docker-network-read-name ()\n \"Read a network name.\"\n (completing-read \"Network: \" (-map #'car (docker-network-entries))))\n\n;;;###autoload\n(defun docker-network-rm (name)\n \"Destroy the network named NAME.\"\n (interactive (list (docker-network-read-name)))\n (docker-run \"network rm\" name))\n\n(defun docker-network-rm-selection ()\n \"Run \\\"docker network rm\\\" on the selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-run \"network rm\" it))\n (tablist-revert))\n\n(magit-define-popup docker-network-rm-popup\n \"Popup for removing networks.\"\n 'docker-network\n :man-page \"docker-network-rm\"\n :actions '((?D \"Remove\" docker-network-rm-selection))\n :setup-function #'docker-utils-popup-setup)\n\n(magit-define-popup docker-network-help-popup\n \"Help popup for docker networks.\"\n 'docker-network\n :actions '(\"Docker networks help\"\n (?D \"Remove\" docker-network-rm-popup)))\n\n(defvar docker-network-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"?\" 'docker-network-help-popup)\n (define-key map \"D\" 'docker-network-rm-popup)\n map)\n \"Keymap for `docker-network-mode'.\")\n\n;;;###autoload\n(defun docker-networks ()\n \"List docker networks.\"\n (interactive)\n (docker-utils-pop-to-buffer \"*docker-networks*\")\n (docker-network-mode)\n (tablist-revert))\n\n(define-derived-mode docker-network-mode tabulated-list-mode \"Networks Menu\"\n \"Major mode for handling a list of docker networks.\"\n (setq tabulated-list-format [(\"Network ID\" 20 t)(\"Name\" 50 t)(\"Driver\" 10 t)])\n (setq tabulated-list-padding 2)\n (setq tabulated-list-sort-key (cons \"Name\" nil))\n (add-hook 'tabulated-list-revert-hook 'docker-network-refresh nil t)\n (tabulated-list-init-header)\n (tablist-minor-mode))\n\n(provide 'docker-network)\n\n;;; docker-network.el ends here\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ docker-20180728.1948/docker.el\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0000644\0\ 0000000\0\ 0000000\0\ 00000005574\0\ 13327220317\0\ 014144\0 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ustar \0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker.el --- Emacs interface to Docker -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n;; URL: https://github.com/Silex/docker.el\n;; Keywords: filename, convenience\n;; Version: 0.7.0\n;; Package-Requires: ((emacs \"24.5\") (dash \"2.14.1\") (docker-tramp \"0.1\") (magit-popup \"2.12.3\") (s \"1.12.0\") (tablist \"0.70\") (json-mode \"1.7.0\"))\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;; # Emacs interface to Docker!\n;;\n;; This package allows you to manipulate docker images, containers & more from Emacs.\n\n;;; Code:\n\n(require 's)\n(require 'dash)\n(require 'magit-popup)\n(require 'docker-utils)\n\n(defgroup docker nil\n \"Docker customization group.\"\n :group 'convenience)\n\n(defcustom docker-run-as-root nil\n \"Run docker as root.\"\n :type 'boolean\n :group 'docker)\n\n(defcustom docker-command \"docker\"\n \"The docker binary.\"\n :type 'string\n :group 'docker)\n\n(defun docker-run (action &rest args)\n \"Execute \\\"docker ACTION\\\" using ARGS.\"\n (let ((default-directory (if (and docker-run-as-root (not (file-remote-p default-directory))) \"/sudo::\" default-directory)))\n (let ((command (format \"%s %s %s %s\"\n docker-command\n (s-join \" \" docker-arguments)\n action\n (s-join \" \" (-flatten (-non-nil args))))))\n (message command)\n (shell-command-to-string command))))\n\n;;;###autoload\n(magit-define-popup docker\n \"Popup for docker.\"\n 'docker\n :man-page \"docker\"\n :options '((?H \"Host\" \"--host \"))\n :actions `(\"Docker\"\n (?c \"Containers\" ,(docker-utils-set-then-call 'docker-arguments 'docker-containers))\n (?i \"Images\" ,(docker-utils-set-then-call 'docker-arguments 'docker-images))\n (?n \"Networks\" ,(docker-utils-set-then-call 'docker-arguments 'docker-networks))\n (?v \"Volumes\" ,(docker-utils-set-then-call 'docker-arguments 'docker-volumes))\n \"Other\"\n (?M \"Machines\" docker-machines)))\n\n(provide 'docker)\n\n(require 'docker-container)\n(require 'docker-image)\n(require 'docker-machine)\n(require 'docker-network)\n(require 'docker-volume)\n\n;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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-machine.el --- Emacs interface to docker-machine -*- lexical-binding: t -*-\n\n;; Author: Ben Swift <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'docker)\n(require 'docker-utils)\n(require 'magit-popup)\n(require 'tablist)\n\n(defgroup docker-machine nil\n \"Docker machine customization group.\"\n :group 'docker)\n\n(defun docker-machine-parse (line)\n \"Convert a LINE from \\\"docker machine ls\\\" to a `tabulated-list-entries' entry.\"\n (let ((data (s-split \"\\t\" line)))\n (list (car data) (apply #'vector data))))\n\n(defun docker-machine-entries ()\n \"Return the docker machines data for `tabulated-list-entries'.\"\n (let* ((fmt \"{{.Name}}\\\\t{{.Active}}\\\\t{{.DriverName}}\\\\t{{.State}}\\\\t{{.URL}}\\\\t{{.Swarm}}\\\\t{{.DockerVersion}}\\\\t{{.Error}}\")\n (data (shell-command-to-string (format \"docker-machine ls %s\" (format \"--format=\\\"%s\\\"\" fmt))))\n (lines (s-split \"\\n\" data t)))\n (-map #'docker-machine-parse lines)))\n\n(defun docker-machine-refresh ()\n \"Refresh the machines list.\"\n (setq tabulated-list-entries (docker-machine-entries)))\n\n(defun docker-machine-read-name ()\n \"Read a machine name.\"\n (completing-read \"Machine: \" (-map #'car (docker-machine-entries))))\n\n(defun docker-machine-run (action &rest args)\n \"Execute \\\"docker-machine ACTION\\\" using ARGS.\"\n (let ((command (format \"docker-machine %s %s\" action (s-join \" \" (-flatten (-non-nil args))))))\n (message command)\n (shell-command-to-string command)))\n\n;;;###autoload\n(defun docker-machine-config (name)\n \"Print the connection config for the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"config\" name))\n\n;;;###autoload\n(defun docker-machine-inspect (name)\n \"Inspect information about the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"inspect\" name))\n\n;;;###autoload\n(defun docker-machine-ip (name)\n \"Get the IP address of the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"ip\" name))\n\n;;;###autoload\n(defun docker-machine-status (name)\n \"Get the status of the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"status\" name))\n\n;;;###autoload\n(defun docker-machine-upgrade (name)\n \"Upgrade the machine NAME to the latest version of Docker.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"upgrade\" name))\n\n;;;###autoload\n(defun docker-machine-kill (name)\n \"Kill the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"kill\" name))\n\n;;;###autoload\n(defun docker-machine-create (name driver)\n \"Create a machine NAME using DRIVER.\"\n (interactive \"sName: \\nsDriver: \")\n (docker-machine-run \"create\" name \"-d\" driver))\n\n;;;###autoload\n(defun docker-machine-start (name)\n \"Start the machine NAME.\"\n (interactive (list (docker-machine-read-name)))\n (docker-machine-run \"start\" name))\n\n(defun docker-machine-env-export (line)\n \"Export the env for LINE.\"\n (let ((index (s-index-of \"=\" line)))\n (unless index\n (error (format \"Cannot find separator in %s\" line)))\n (setenv (substring line (length \"export \") index) (substring line (+ 2 index) -1))))\n\n;;;###autoload\n(defun docker-machine-env (name)\n \"Parse and set environment variables from \\\"docker-machine env NAME\\\" output.\"\n (interactive (list (docker-machine-read-name)))\n (--each-while\n (s-lines (docker-machine-run \"env\" name))\n (s-prefix? \"export\" it)\n (docker-machine-env-export it)))\n\n;;;###autoload\n(defun docker-machine-stop (name)\n \"Stop the machine NAME.\"\n (interactive (list (docker-machine-read-name) current-prefix-arg))\n (docker-machine-run \"stop\" name))\n\n;;;###autoload\n(defun docker-machine-restart (name)\n \"Restart the machine NAME.\"\n (interactive (list (docker-machine-read-name) current-prefix-arg))\n (docker-machine-run \"restart\" name))\n\n;;;###autoload\n(defun docker-machine-rm (name &optional force)\n \"Destroy or uncommand the machine NAME. If FORCE is set, use \\\"--force\\\".\"\n (interactive (list (docker-machine-read-name) current-prefix-arg))\n (docker-machine-run \"rm\" (when force \"--force\") name))\n\n(defun docker-machine-start-selection ()\n \"Run `docker-machine-start' on the machines selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-machine-run \"start\" (docker-machine-start-arguments)))\n (tablist-revert))\n\n(defun docker-machine-stop-selection ()\n \"Run `docker-machine-stop' on the machines selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-machine-run \"stop\" (docker-machine-stop-arguments)))\n (tablist-revert))\n\n(defun docker-machine-restart-selection ()\n \"Run `docker-machine-restart' on the machines selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-machine-run \"restart\" (docker-machine-restart-arguments)))\n (tablist-revert))\n\n(defun docker-machine-rm-selection ()\n \"Run `docker-machine-rm' on the machines selection.\"\n (interactive)\n (--each (docker-utils-get-marked-items-ids)\n (docker-machine-run \"rm\" (docker-machine-rm-arguments)))\n (tablist-revert))\n\n(defun docker-machine-env-selection ()\n \"Run \\\"docker-machine env\\\" on selected machine.\"\n (interactive)\n (let ((marked (docker-utils-get-marked-items-ids)))\n (when (/= (length marked) 1)\n (error \"Can only set environment vars for one machine at a time\"))\n (docker-machine-env (car marked))\n (tablist-revert)))\n\n(magit-define-popup docker-machine-start-popup\n \"Popup for starting machines.\"\n 'docker-machine\n :man-page \"docker-machine-start\"\n :actions '((?S \"Start\" docker-machine-start-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-machine-env-popup\n \"Popup for setting up environment variables.\"\n 'docker-machine\n :man-page \"docker-machine-env\"\n :actions '((?E \"Env\" docker-machine-env-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-machine-stop-popup\n \"Popup for stoping machines.\"\n 'docker-machine\n :man-page \"docker-machine-stop\"\n :actions '((?O \"Stop\" docker-machine-stop-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-machine-restart-popup\n \"Popup for restarting machines.\"\n 'docker-machine\n :man-page \"docker-machine-restart\"\n :actions '((?R \"Restart\" docker-machine-restart-selection))\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-machine-rm-popup\n \"Popup for removing machines.\"\n 'docker-machine\n :man-page \"docker-machine-rm\"\n :switches '((?y \"Automatic yes\" \"-y\")\n (?f \"Force\" \"-f\"))\n :actions '((?D \"Remove\" docker-machine-rm-selection))\n :default-arguments '(\"-y\")\n :setup-function #'docker-utils-setup-popup)\n\n(magit-define-popup docker-machine-help-popup\n \"Help popup for docker machine.\"\n 'docker-machine\n :actions '(\"Docker machines help\"\n (?C \"Create\" docker-machine-create)\n (?D \"Remove\" docker-machine-rm-popup)\n (?E \"Env\" docker-machine-env-popup)\n (?O \"Stop\" docker-machine-stop-popup)\n (?R \"Restart\" docker-machine-restart-popup)\n (?S \"Start\" docker-machine-start-popup)))\n\n(defvar docker-machine-mode-map\n (let ((map (make-sparse-keymap)))\n (define-key map \"?\" 'docker-machine-help-popup)\n (define-key map \"C\" 'docker-machine-create)\n (define-key map \"D\" 'docker-machine-rm-popup)\n (define-key map \"E\" 'docker-machine-env-popup)\n (define-key map \"O\" 'docker-machine-stop-popup)\n (define-key map \"R\" 'docker-machine-restart-popup)\n (define-key map \"S\" 'docker-machine-start-popup)\n map)\n \"Keymap for `docker-machine-mode'.\")\n\n;;;###autoload\n(defun docker-machines ()\n \"List docker machines.\"\n (interactive)\n (docker-utils-pop-to-buffer \"*docker-machines*\")\n (docker-machine-mode)\n (tablist-revert))\n\n(define-derived-mode docker-machine-mode tabulated-list-mode \"Machines Menu\"\n \"Major mode for handling a list of docker machines.\"\n (setq tabulated-list-format [(\"Name\" 16 t)(\"Active\" 7 t)(\"Driver\" 12 t)(\"State\" 12 t)(\"URL\" 30 t)(\"Swarm\" 10 t)(\"Docker\" 10 t)(\"Errors\" 10 t)])\n (setq tabulated-list-padding 2)\n (setq tabulated-list-sort-key (cons \"Name\" nil))\n (add-hook 'tabulated-list-revert-hook 'docker-machine-refresh nil t)\n (tabulated-list-init-header)\n (tablist-minor-mode))\n\n(provide 'docker-machine)\n\n;;; docker-machine.el ends here\n\0\0\0\0\0\ docker-20180728.1948/docker-utils.el\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0000644\0\ 0000000\0\ 0000000\0\ 00000005451\0\ 13327220317\0\ 015274\0 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ustar \0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0root\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;;; docker-utils.el --- Random utilities -*- lexical-binding: t -*-\n\n;; Author: Philippe Vaucher <[email protected]>\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n;;\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n;; GNU General Public License for more details.\n;;\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file COPYING. If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;;; Code:\n\n(require 'dash)\n(require 'tablist)\n(require 'magit-popup)\n\n(defun docker-utils-get-marked-items ()\n \"Get the marked items data from `tabulated-list-entries'.\"\n (save-excursion\n (goto-char (point-min))\n (let ((selection ()))\n (while (not (eobp))\n (when (not (null (tablist-get-mark-state)))\n (setq selection (-snoc selection (cons (tabulated-list-get-id) (tabulated-list-get-entry)))))\n (forward-line))\n selection)))\n\n(defun docker-utils-get-marked-items-ids ()\n \"Get the id part of `docker-utils-get-marked-items'.\"\n (-map #'car (docker-utils-get-marked-items)))\n\n(defun docker-utils-setup-popup (val def)\n (magit-with-pre-popup-buffer (docker-utils-select-if-empty))\n (magit-popup-default-setup val def))\n\n(defun docker-utils-select-if-empty (&optional arg)\n \"Select current row is selection is empty.\nARG is unused here, but is required by `add-function'.\"\n (save-excursion\n (when (null (docker-utils-get-marked-items))\n (tablist-put-mark))))\n\n(defun docker-utils-set-then-call (variable func)\n \"Return a lambda settings VARIABLE before calling FUNC.\"\n (lambda ()\n (interactive)\n (set variable (funcall variable))\n (call-interactively func)))\n\n(defun docker-utils-pop-to-buffer (name)\n \"Like `pop-to-buffer', but suffix NAME with the host if on a remote host.\"\n (pop-to-buffer\n (if (file-remote-p default-directory)\n (with-parsed-tramp-file-name default-directory nil (concat name \" - \" host))\n name)))\n\n(defmacro docker-utils-with-buffer (name &rest body)\n \"Wrapper around `with-current-buffer'.\nExecute BODY in a buffer.\"\n (declare (indent defun))\n `(with-current-buffer (generate-new-buffer (format \"* docker - %s *\" ,name))\n (setq buffer-read-only nil)\n (erase-buffer)\n ,@body\n (setq buffer-read-only t)\n (goto-char (point-min))\n (pop-to-buffer (current-buffer))))\n\n(provide 'docker-utils)\n\n;;; docker-utils.el ends here\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0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-archive(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil))
mapc(package-install-from-archive (#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil)))
package-download-transaction((#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil)))
package-install(#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil) dont-select)
package-menu--perform-transaction((#s(package-desc :name docker :version (20180728 1948) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind tar :archive "melpa" :dir nil :extras ((:commit . "1fa68a9eca5d5a1541b06a82e348c0fcdff7b621") (:keywords "filename" "convenience") (:authors ("Philippe Vaucher" . "[email protected]")) (:maintainer "Philippe Vaucher" . "[email protected]") (:url . "https://github.com/Silex/docker.el")) :signed nil)) (#s(package-desc :name docker :version (20180710 1443) :summary "Emacs interface to Docker" :reqs ((emacs (24 5)) (dash (2 14 1)) (docker-tramp (0 1)) (magit-popup (2 12 3)) (s (1 12 0)) (tablist (0 70)) (json-mode (1 7 0))) :kind nil :archive nil :dir "/home/haifeng/.emacs.d/elpa-26.1/docker-20180710.1443" :extras ((:url . "https://github.com/Silex/docker.el") (:maintainer "Philippe Vaucher" . "[email protected]") (:authors ("Philippe Vaucher" . "[email protected]")) (:keywords "filename" "convenience")) :signed nil)))
package-menu-execute()
funcall-interactively(package-menu-execute)
call-interactively(package-menu-execute nil nil)
command-execute(package-menu-execute)
Could you please look into this?
Should we use https://github.com/Fuco1/ETable or https://www.gnu.org/software/emacs/manual/html_node/elisp/Tabulated-List-Mode.html?
Here's the list of requirements:
ETable supports all of this but still needs work to be done on it. Tabulated List Mode is standard emacs, if it supports all of it it's probably a better option?
The Created column appears to be sorted lexicographically, which doesn't give good results when the values are things like "3 hours", "13 days", and "2 weeks".
I don't know of a way to get docker to output ages in a consistent time unit. Maybe adding the Creation date column would be a good workaround since it might be more easily sorted?
Useful package, though, thanks!
Recently, I realized I was making a lot of similar codes, which define the tabulated list buffer, and then set the magit popups. I noticed they could be turned into macro, and made this package:
https://github.com/Yuki-Inoue/tblui.el
I think adopting this would clean up the codebase and enable the code concentrate on docker logic. Any pinion?
This is what I see when I try to have an interactive output.
(github markdown interpret these characters chains ...)
Current implementation of docker ps result to docker-container
conversion is ad-hoc, and easily broken (at least in my local env, in the way I use my docker... ). This results in, for example, not correct invocation of C-c d c X
(X is a placeholder).
It would be nice if this conversion is done in a more accurate manner.
Related: #11 (I believe this issue is an instance of such broken conversion)
docker rmi hello-world:latest -f
which is produced by D -f D
in docker-images
results in error:
Failed to remove image (hello-world:latest): Error response from daemon: conflict: unable to remove repository reference "hello-world:latest" (must force) - container f6fb337fbe2e is using its referenced image 690ed74de00f
Failed to remove image (-f): Error response from daemon: No such image: -f:latest
Should not rmi with force switch produce something like docker rmi -f hello-world:latest
? I'm really new to Docker, so excuse me if I'm wrong.
While we now have lots of options to filter the tables, it seems to be rather generic and not really related to docker workflows. For example, I would like to have filters like "select untagged images" or "select stopped containers" or "select all containers for this compose stack" and similar. I can't really even find much use for the listings we have now as I deal with docker-compose
99% of the time.
Do you think something like that would be possible? Maybe as separate popups.
Hello! Thanks for this great package 👍
I'm trying to run some commands from elisp directly. I looked into docker-images-run-selection
and it relies on docker-images-selection
function to get the selected images. How can I select an image and run a given command using elisp?
I'm not sure if my question defeats the whole purpose of this package and I should run the command using async-shell-command
😄
I want the docker-containers
(or other table list interfaces) to be invoked by considering the current buffer's host. That is, when I'm logging in a server with tramp, and kick the docker-containers
, it successfully show the list of containers on that logged in host.
Now let's say I wanted to see the containers list on my local host pc.
What I need to do is to
*docker-containers*
bufferdocker-containers
command on the buffer whose associated file is on my host pc.Or otherwise I'd still see the containers list of the tramp logged in target pc, even if I kick docker-containers
on the buffer (which is associated local host's file). I thought just re-creating a buffer wouldn't be so much of a cost, so I thought recreating the buffer on each funciton invocation would solve this problem.
Any opinion?
Items | Description | Done |
---|---|---|
compose | docker-compose | Yes |
container | Manage containers | Yes |
image | Manage images | Yes |
machine | docker-machine | Yes |
network | Manage networks | Yes |
node | Manage Swarm nodes | |
plugin | Manage plugins | |
secret | Manage Docker secrets | |
service | Manage services | |
stack | Manage Docker stacks | |
swarm | Manage Swarm | |
system | Manage Docker | |
volume | Manage volumes | Yes |
Command | Description | Done |
---|---|---|
attach | Attach to a running container | |
build | Build an image from a Dockerfile | Yes |
commit | Create a new image from a container's changes | |
cp | Copy files/folders between a container and the local filesystem | Yes |
create | Create a new container | |
diff | Inspect changes on a container's filesystem | Yes |
events | Get real time events from the server | |
exec | Run a command in a running container | |
export | Export a container's filesystem as a tar archive | |
history | Show the history of an image | |
images | List images | |
import | Import the contents from a tarball to create a filesystem image | |
info | Display system-wide information | |
inspect | Return low-level information on Docker objects | Yes |
kill | Kill one or more running containers | Yes |
load | Load an image from a tar archive or STDIN | |
login | Log in to a Docker registry | |
logout | Log out from a Docker registry | |
logs | Fetch the logs of a container | Yes |
pause | Pause all processes within one or more containers | |
port | List port mappings or a specific mapping for the container | |
ps | List containers | |
pull | Pull an image or a repository from a registry | |
push | Push an image or a repository to a registry | |
rename | Rename a container | Yes |
restart | Restart one or more containers | |
rm | Remove one or more containers | |
rmi | Remove one or more images | |
run | Run a command in a new container | |
save | Save one or more images to a tar archive (streamed to STDOUT by default) | |
search | Search the Docker Hub for images | |
start | Start one or more stopped containers | Yes |
stats | Display a live stream of container(s) resource usage statistics | |
stop | Stop one or more running containers | |
tag | Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE | Yes |
top | Display the running processes of a container | |
unpause | Unpause all processes within one or more containers | Yes |
update | Update configuration of one or more containers | |
version | Show the Docker version information | |
wait | Block until one or more containers stop, then print their exit codes |
Hello, (more a question than an issue)
I used docker with sudo command on my computer. Is it possible to user this package (docker.el) in emacs with root privilège in a simple way ?
Two solutions that I want to avoid :
-configure my emacs in root user ?
-reinstall docker for running as user
thanks
fred
It would be great to have at least a brief description of what that package offers ! so than we aren't obliged to read from source.
Screenshots would be nice so than emacs can easily compare to other editors on this page for example: http://domeide.github.io/#emacs (from http://www.reddit.com/r/emacs/comments/3a2epo/docker_meets_the_ide_emacs_help_needed/)
Hello,
Maybe I'm doing it wrong but everytime I try to run a command I get "No containers selected", but how am I supposed to "select" a container ? I suppose my pointer on the buffer just have to be on the line of the container I want to run the action on ?
Thanks.
Would be nice to have this one as well.
Hi there! It seems like there are some troubles with dependencies and json-mode. When i'm attempting to install i'm getting this:
Error: (file-error "http://melpa.org/packages/json-mode-20170418.1900.el" "Not found")
Not sure if this project is still alive, but is there a way to use this with Docker for Mac?
Sometimes I'd like to see the full list of images but I'm not sure how to accomplish that with this plugin.
Excellent plugin otherwise btw.
I have my system shell default set to fish
, but fish
doesn't exist within the docker container. When I attempt to open a shell via docker-container-shell
, it complains that the shell does not exist.
Am I doing something wrong? If not, having what shell to run in docker containers being customizable would be amazing!
Steal from magit-process :)
Docker layer: Running docker-containers
fails on Windows
M-x docker-containers
Observed behaviour:
docker-containers-refresh: Symbol’s value as variable is void: docker-containers-show-all
Expected behaviour:
To see a listing of my docker containers
My docker usage pattern is always by docker-compose.
With version 2 I even do not tag image by myself, it's done automatically.
So docker-compose support is highly requested :)
I'd be happy to do this by myself, but unfortunately have lack of experience.
Hello,
Starting tomorrow I'll be on vacation for 2 weeks.
Hello,
I'm running docker on my system with sudo docker ...
instead of just docker
. It would be great if the docker command could be customized.
I defer loading magit for startup perf reasons. It seems docker.el now attempts to create its popup when initializing autoloads, which is too early, so it errors because magit-define-popup
is not yet defined.
As discussed in #13 , its nice to select the current element in the list if nothing is selected.
Hi Docker.el developers,
Thanks for a great mode, I am now using it as my main way of interfacing with Docker. However, I have a slight problem: I am trying to supply several environment variables to my containers, in a similar approach to what is suggested here [1]. I haven't quite figured out how to do this with Docker.el. I am using the Run
command and the -e
for environment. If I try to put all the variables in one line like so:
USER_NAME=$(whoami) USER_ID=$(id -u) GROUP_ID=$(id -g)
I get an error:
docker: invalid reference format: repository name must be lowercase.
Presumably the shell is getting confused because -e
does not support multiple variables; instead one expects multiple -e
, one per variable. However, I can't see how to do that from the UI. I also tried quoting:
"USER_NAME=$(whoami) USER_ID=$(id -u) GROUP_ID=$(id -g)"
The container then starts, but I get this:
/ # env | grep USER
USER_NAME=xyz USER_ID=1000 GROUP_ID=1000
It seems USER_NAME
was set to the rest of the string. Is there a way to supply multiple environment variables? I also looked for --env-file
but I can't find it.
Thanks in advance.
Marco
I often use containers that run tests, then stop. If I try to get a shell into one of these via b b
in the container view, it only works for running containers. It would be great to have another option for "start + persistent shell" equivalent to docker run -it <container_name> /bin/bash
.
I found some commands will block emacs like docker-machine-create
and docker-push
etc.
Like magit for example, when you run magit push
it will execute in background without blocking emacs. I think this might be more preferable?
62ce93f introduced docker popup options, but seems to lack docker-arguments
:
When I kick docker-images
locally, the Repository is shown in the way like docker-registry.mydomain/yu...
. Especially on private registry, the most important part of the repo (the image name) is abbreviated into dots of ...
.
So I thought it would be helpful to make the column widths configurable.
The only thing that is available to execute is setting up the global keys. Yet non of the commands are available.
However if I proceed to (let it be) docker-images.el
file and eval it, then all the images related commands are available. Are we supposed to require each module manually? If yes, then this should be reflected in the documentation.
docker-machine-env
fails with message:
Non-hex digit used for Unicode escape
The cause is the read
function used in docker-machine-env-export
expects the \
in the string to be double-escaped.
Installed from MELPA, could not make it work the first time since I didn't have magit-popup
installed prior.
@benswift, I'm not a user of docker-machine, can you tell me wether incorporating
dougm@b328f22#diff-34b17d4fecbd8f93346451d97efbe510R36
Is relevant? Also, can you test wether docker-machine works correctly in my merge? Would you be interested into being added as a maintainer for the docker-machine part?
Thanks 😉
<>
resize column
* r
mark by regexp
/ r
filter by regexp
etc.
Also make a PR for tablist repo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.