Connecting to a running Erlang application release in a docker container


Please briefly explain why you feel this question should be reported .

Report Cancel

This is embarassing, but I am totally stuck and wasted the better part of this morning. I have an Erlang app release created by relx, deployed and running in a Docker container. I need to get to the shell on the running node, but I’m failing to do so. Here is what happens:

$ docker exec -it 770b497d7f27 /bin/bash
[[email protected] /]# /app/bin/ff 
Usage: ff {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|escript|rpc|rpcterms}
[[email protected] /]# /app/bin/ff ping
[[email protected] /]# /app/bin/ff attach
Can't access pipe directory [email protected]/: No such file or directory
[[email protected] /]# /app/bin/ff remote_console
Eshell V7.1  (abort with ^G)
([email protected])1> ^G
Eshell V7.1  (abort with ^G)
([email protected])1> 

And that’s it – I can exit with q()..

There is no erl_pipes in /tmp.

Control-G seems to be captured by Docker. I cannot get to the “User switch command” menu.

Even running a pure Erlang shell is not so easy:

[[email protected] /]# /app/erts-7.1/bin/erl
{"init terminating in do_boot",{'cannot get bootfile','/app/bin/start.boot'}}

Crash dump is being written to: erl_crash.dump...done
init terminating in do_boot ()

I have run out of ideas. Any help would be appreciated.

solved 0
1 Answer 36 views 0

Answer ( 1 )

    November 14, 2016 at 7:10 pm

    Please briefly explain why you feel this answer should be reported .

    Report Cancel

    Found a workaround, managed to get ^G working by overriding the default “dumb” terminal docker sets:

    export TERM=xterm

    After this ^G works, starting a remote shell works, and I’m a happy camper! Would be glad to know why neither the attach nor the remote_console commands work though.

    Best answer

Leave an answer


What is the capital of Egypt ? ( Cairo )

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>