gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

Support Docker using docker-tramp #66

Closed norci closed 2 years ago

norci commented 2 years ago

for #65 . In the docker container, the listen address should be 0.0.0.0, not localhost, or port can not be published.

norci commented 2 years ago

I used docker-tramp to open files. then julia snail worked perfectly.

I added these custom vars:

(custom-set-variables
 '(julia-snail-host "0.0.0.0")
)

added a file in the docker compose dir. docker-compose.override.yml

version: "3"
services:
  julia:
    ports:
      - 127.0.0.1:10011:10011
    volumes:
      - ${HOME}/.emacs.d/julia-snail/:${HOME}/.emacs.d/julia-snail/:ro

I want to make julia-snail-host a local var, if the tramp method is "docker", then set its value to "0". But I have no idea about it. Could you tell me how? thanks.

gcv commented 2 years ago

Nice! Please post a complete sample docker compose configuration so I can give this a try.

norci commented 2 years ago

try this run docker run --name julia-1 --rm -it -p 127.0.0.1:10011:10011 -v ${HOME}/.emacs.d/julia-snail/:${HOME}/.emacs.d/julia-snail/ julia bash then eval (docker-container-find-directory "julia-1" "/") in buffer /docker:julia-1:/ run julia-snail.

norci commented 2 years ago

thanks for your advise. I have tested it on local, ssh, docker. it worked.

gcv commented 2 years ago

Thank you for contributing to Snail! I merged your PR, and added documentation to the CHANGELOG and README files.