Function: nrepl--container-published-port

nrepl--container-published-port is a byte-compiled function defined in nrepl-client.el.

Signature

(nrepl--container-published-port METHOD CONTAINER PORT)

Documentation

Return the host port CONTAINER publishes PORT on, or nil.

METHOD is the container CLI to use ("docker" or "podman"), run on the local machine. Ports that the container doesn't publish yield nil.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/nrepl-client.el
(defun nrepl--container-published-port (method container port)
  "Return the host port CONTAINER publishes PORT on, or nil.
METHOD is the container CLI to use (\"docker\" or \"podman\"), run on
the local machine.  Ports that the container doesn't publish yield nil."
  (with-temp-buffer
    (when (eq 0 (ignore-errors
                  (call-process method nil t nil
                                "port" container (format "%s/tcp" port))))
      ;; output looks like "0.0.0.0:12345\n[::]:12345"
      (goto-char (point-min))
      (when (re-search-forward ":\\([0-9]+\\)$" nil t)
        (string-to-number (match-string 1))))))