all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brian Cully via "Emacs development discussions." <emacs-devel@gnu.org>
To: Michael Albinus <Michael.Albinus@gmx.de>
Cc: miha@kamnitnik.top, Brian Cully <bjc@kublai.com>, emacs-devel@gnu.org
Subject: Re: master 152c7322c1: * lisp/net/tramp-docker.el: New file.
Date: Tue, 4 Oct 2022 11:32:07 -0400	[thread overview]
Message-ID: <aca32981-60d7-28ad-6f52-a9ccaea0b441@spork.org> (raw)
In-Reply-To: <87o7usolk2.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

On 10/3/22 13:37, Michael Albinus wrote:
> OK. Would you like to provide a patch? Including a ChangeLog-like commit
> message.

Is this okay?

-bjc

[-- Attachment #2: 0001-Provide-Podman-containers-on-their-own-method.patch --]
[-- Type: text/x-patch, Size: 3366 bytes --]

From 2273214c59794ca6fca59b08ed0f4b298520d307 Mon Sep 17 00:00:00 2001
From: Brian Cully <bjc@kublai.com>
Date: Tue, 4 Oct 2022 09:57:35 -0400
Subject: [PATCH] Provide Podman containers on their own method.

* tramp-docker.el (tramp-podman-program): New defcustom.
(tramp-podman-method): New defconst.
(tramp-docker-program): Remove "podman" from option list.
(top): update comments to refer to Docker-alike where necessary.
Add description for how to use the podman method.
---
 lisp/tramp-docker.el | 39 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/lisp/tramp-docker.el b/lisp/tramp-docker.el
index 12fabfe7..e7657414 100644
--- a/lisp/tramp-docker.el
+++ b/lisp/tramp-docker.el
@@ -1,4 +1,4 @@
-;;; tramp-docker.el --- Tramp integration for Docker containers  -*- lexical-binding: t; -*-
+;;; tramp-docker.el --- Tramp integration for Docker-like containers  -*- lexical-binding: t; -*-
 
 ;; Copyright © 2022 Free Software Foundation, Inc.
 
@@ -24,14 +24,18 @@
 ;;; Commentary:
 
 ;; ‘tramp-docker’ allows Tramp access to environments provided by
-;; Docker.
+;; Docker and similar programs.
 ;;
 ;; ## Usage
 ;;
-;; Open a file on a running systemd-docker container:
+;; Open a file on a running Docker container:
 ;;
 ;;     C-x C-f /docker:USER@CONTAINER:/path/to/file
 ;;
+;; or Podman:
+;;
+;;     C-x C-f /podman:USER@CONTAINER:/path/to/file
+;;
 ;; Where:
 ;;     USER          is the user on the container to connect as (optional)
 ;;     CONTAINER     is the container to connect to
@@ -46,16 +50,27 @@
   :group 'tramp
   :version "29.1"
   :type '(choice (const "docker")
-                 (const "podman")
+                 (string)))
+
+;;;###tramp-autoload
+(defcustom tramp-podman-program "podman"
+  "Name of the Podman client program."
+  :group 'tramp
+  :version "29.1"
+  :type '(choice (const "podman")
                  (string)))
 
 ;;;###tramp-autoload
 (defconst tramp-docker-method "docker"
   "Tramp method name to use to connect to Docker containers.")
 
+;;;###tramp-autoload
+(defconst tramp-podman-method "podman"
+  "Tramp method name to use to connect to Podman containers.")
+
 ;;;###tramp-autoload
 (defun tramp-docker--completion-function (&rest _args)
-  "List Docker containers available for connection.
+  "List Docker-like containers available for connection.
 
 This function is used by `tramp-set-completion-function', please
 see its function help for a description of the format."
@@ -89,9 +104,23 @@ see its function help for a description of the format."
          (tramp-remote-shell-login ("-l"))
          (tramp-remote-shell-args ("-i" "-c")))
        tramp-methods)
+ (push `(,tramp-podman-method
+         (tramp-login-program ,tramp-podman-program)
+         (tramp-login-args (("exec")
+                            ("-it")
+                            ("-u" "%u")
+                            ("%h")
+			    ("%l")))
+         (tramp-remote-shell ,tramp-default-remote-shell)
+         (tramp-remote-shell-login ("-l"))
+         (tramp-remote-shell-args ("-i" "-c")))
+       tramp-methods)
 
  (tramp-set-completion-function
   tramp-docker-method
+  '((tramp-docker--completion-function "")))
+ (tramp-set-completion-function
+  tramp-podman-method
   '((tramp-docker--completion-function ""))))
 
 (add-hook 'tramp-unload-hook
-- 
2.37.3


  reply	other threads:[~2022-10-04 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 16:50 master 152c7322c1: * lisp/net/tramp-docker.el: New file miha
2022-09-29 17:28 ` Michael Albinus
2022-10-03 13:44   ` Brian Cully via Emacs development discussions.
2022-10-03 17:37     ` Michael Albinus
2022-10-04 15:32       ` Brian Cully via Emacs development discussions. [this message]
2022-10-04 16:58         ` Michael Albinus
2022-10-04 17:43           ` Brian Cully via Emacs development discussions.
2022-10-04 18:00             ` Michael Albinus
2022-10-04 18:17               ` Brian Cully via Emacs development discussions.
2022-10-04 18:20                 ` Michael Albinus
2022-10-04 18:33                   ` Brian Cully via Emacs development discussions.
2022-10-04 18:36                     ` Michael Albinus
2022-10-04 18:45                       ` Brian Cully via Emacs development discussions.
2022-10-04 19:21                         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aca32981-60d7-28ad-6f52-a9ccaea0b441@spork.org \
    --to=emacs-devel@gnu.org \
    --cc=Michael.Albinus@gmx.de \
    --cc=bjc@kublai.com \
    --cc=bjc@spork.org \
    --cc=miha@kamnitnik.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.