tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp-container doesn't follow `ENV PATH` in docker file


From: ParetoOptimalDev
Subject: Re: tramp-container doesn't follow `ENV PATH` in docker file
Date: Wed, 15 Mar 2023 23:39:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

I made some progress and I figured out how to get the `ENV PATH` value
with a weird hacky feeling method:

#+begin_src sh
docker run -t haskell bash -c 'env PATH=$PATH bash -c "echo $PATH"'
#+end_src

#+RESULTS:
:
/root/.cabal/bin:/root/.local/bin:/opt/ghc/9.4.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I tried to modify the `tramp-docker-method` in `tramp-methods` to
utilize the above command but it didn't work.

Here was my attempt:

(add-to-list 'tramp-methods
              `(,tramp-docker-method
                (tramp-login-program ,tramp-docker-program)
                (tramp-login-args (("exec")
                                   ("-it")
                                   ("-u" "%u")
                                   ("%h")
                                   ("%l")
                                   ))
                (tramp-direct-async (,tramp-default-remote-shell "-c"))
                (tramp-remote-shell ,tramp-default-remote-shell)
                (tramp-remote-shell-login ("-l"))
                (tramp-remote-shell-args ("-i" "-c" "'env
              PATH=$PATH'"))))

Can anyone help with this?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]