I have two docker images containing a released elixir app.
I run these two dockers on my local machine.
And I'm trying to connect the two nodes.
How can i run the released app on a named node?
or - is there any other way to do that ?
This is how you would do it without docker-compose for Erlang nodes.
docker network create example
$ docker run --rm -it --name bar -h bar --net example erlang:19.3 /bin/bash
root@bar:/# erl -sname bar -setcookie example
Erlang/OTP 19 [erts-8.3.5.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.3.5.1 (abort with ^G)
(bar@bar)1>
docker run --rm -it --name foo -h foo --net example erlang:19.3 /bin/bash
root@foo:/# erl -sname foo -setcookie example
Erlang/OTP 19 [erts-8.3.5.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.3.5.1 (abort with ^G)
(foo@foo)1>
(foo@foo)1> net_adm:ping(bar@bar).
pong
(bar@bar)1> net_adm:ping(foo@foo).
pong
bash shell in one of the two docker containersdocker exec -it foo /bin/bash
Where foo is the name for the docker container.
./rel/your_app/bin/your_app console
I assume you know the path to the release inside the container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With