这很尴尬,但我完全被困住了,浪费了今天早上的大部分时间。我有一个由 relx 创建的 Erlang 应用程序版本,部署并运行在 Docker 容器中。我需要进入正在运行的节点上的 shell,但我没有这样做。这是发生的事情:
$ docker exec -it 770b497d7f27 /bin/bash
[root@ff /]# /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}
[root@ff /]# /app/bin/ff ping
pong
[root@ff /]# /app/bin/ff attach
Can't access pipe directory /tmp/erl_pipes/ff@127.0.0.1/: No such file or directory
[root@ff /]# /app/bin/ff remote_console
Eshell V7.1 (abort with ^G)
(remshfbfbd4dd-ff@127.0.0.1)1> ^G
Eshell V7.1 (abort with ^G)
(remshfbfbd4dd-ff@127.0.0.1)1>
就是这样 - 我可以使用 q().
退出。
/tmp
中没有erl_pipes
。
Control-G 似乎被 Docker 捕获了。我无法进入“用户切换命令”菜单。
即使运行纯 Erlang shell 也不是那么容易:
[root@ff /]# /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 ()
我已经没有想法了。任何帮助将不胜感激。
最佳答案
找到了一个解决方法,通过覆盖默认的“哑”终端 docker 集设法让 ^G 工作:
export TERM=xterm
在这个 ^G 工作之后,启动远程 shell 工作,我是一个快乐的露营者!很高兴知道为什么 attach
和 remote_console
命令都不起作用。
关于docker - 连接到 docker 容器中正在运行的 Erlang 应用程序版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34654963/