Closed metasoarous closed 3 years ago
Looks like I sorted this out. The problem was that I needed to set :bind "0.0.0.0"
in the call to (nrepl-server/start-server ...)
. I eventually realized that in the project where I had this working, this was set in the .nrepl.edn
file, which the -m nrepl.cmdline
invocation was picking up. Not sure why this is specifically necessary in this case, or how I figured out how to set this previously, but in any case I'm past the hurdle.
Thanks
I seem to be unable to connect to an embedded repl using vim-fireplace when the embedded repl is running from within docker.
I've got an alias set up so that I can run
clojure -X:the-alias
, which calls out to a function which (does some stuff) and in turn calls(nrepl-server/start-server :port 8889 :hander cider.nrepl/cider-nrepl-handler)
, as per guidance on the cider/nrepl docs.When I simply run
clojure -X:the-alias
directly from my machine, I'm able to:Connect 8889
from vim without issue. However, I'd like to set this command up to automatically run from docker/docker-compose (we've got a system with several components, and as a dev convenience, I'd like to be able to have folks run the entire system withdocker-compose up
for smooth dev onboarding without having to set up an entire development environment on their local machine). However, when I try to connect to the same process running from docker/docker-compose, I get the following error:Interestingly, if I try to connect again, even after shutting down the docker container and running from outside docker, I then get:
What's weird is that I've successfully connected to an nREPL process running from within docker before, but in this case, it wasn't an embedded call; It was calling
clojure -R:nREPL -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" --port 3850
from within a run script called by theDockerfile
. (You can see this setup here: https://github.com/compdemocracy/analysis).Any idea what might be going on here, or how I can get around this issue? Please let me know if there's any additional information which would be helpful.
Thanks so much.