Fork me on GitHub
#luminus
<
2017-09-20
>
staypufd19:09:09

@yogthos I am trying to get my projectd nrepl running in a Docker container. Have you done that before? I keep getting a error from nrepl. “Caused by: java.net.SocketException: Protocol family unavailable at java.net.PlainSocketImpl.socketBind(Native Method)” and I’ve updated my Dockerfile (generated by the lein setup stuff with the + options for Luminus) to expose port 7000 and updated the CMD - CMD [“lein”, “uberjar” “-Djava.net.preferIPv4Stack=true”] to prefer IP4 addresses like several people mention online, but none of those have worked. So I thought I’d reach out

staypufd19:09:48

I even added :nrepl-host “0.0.0.0” to the config.edn file that was generated when I created the project

staypufd19:09:25

and then modified the call to mount/def-state for the repl/server to have it:

staypufd19:09:50

I’m using Docker Mac as well since that may matter

yogthos19:09:19

@staypufd I’m guessing you checked, but are you mapping the port back to the host? docker run -p 7000:7000

yogthos19:09:55

the nrepl port shouldn’t be any different from exposing http port as far as I know

staypufd19:09:24

I’m running it in the IntelliJ Docker but I have all ports mapped chosen and when I do docker inspect it shows it’s mapped

staypufd19:09:47

that’s what I was thinking

staypufd19:09:41

so the port is exported 32825

staypufd19:09:13

but what’s weird is that I get this exception and nrepl fails to run

staypufd19:09:13

Caused by: java.net.SocketException: Protocol family unavailable at java.net.PlainSocketImpl.socketBind(Native Method)

staypufd19:09:52

that’s where the suggestion from someone who also saw that error to put the -Djava.net.preferIPv4Stack=true

staypufd19:09:12

there is the stacktrace showing the leadup from mount to luminus.repl …

staypufd19:09:15

if that helps

yogthos19:09:19

this is vaguely familiar actually and I think it might have to do with the host nrepl is trying to bind to

yogthos19:09:21

>FYI: java.net.preferIPv4Addresses does absolutely nothing. this is not a recognized property by java.

staypufd19:09:25

y that’s one I found

staypufd19:09:01

First time using Docker so I’m hitting all the issues 😉

yogthos19:09:13

yeah I find networking in docker gets tricky

staypufd19:09:37

yeah, even the docs are a huge nasty place

yogthos19:09:55

I think you do want to listen on .0.0.0.0 in the container, and you have to make sure docker is allowing ipv4

yogthos19:09:21

but don’t recall what the magic incantation is 🙂

staypufd20:09:16

thanks for the help. I’ll see if I can figure that out

yogthos20:09:52

if you do, might be good to add a “docker” section in deployment docs https://github.com/luminus-framework/luminus/blob/master/resources/md/deployment.md

staypufd20:09:36

Sure - If I figure it out, I’ll add a section

staypufd20:09:49

I’m wondering if it may also have something to do with DockerMac

staypufd20:09:55

but I’ll let you know