docker - 连接到 docker 容器中正在运行的 Erlang 应用程序版本

标签 docker erlang relx

这很尴尬,但我完全被困住了,浪费了今天早上的大部分时间。我有一个由 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 工作,我是一个快乐的露营者!很高兴知道为什么 attachremote_console 命令都不起作用。

关于docker - 连接到 docker 容器中正在运行的 Erlang 应用程序版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34654963/

相关文章:

docker - 的区别是什么?和./在RUN中

erlang - 无法在 MAC OSX Mojave 上安装 asdf erlang

c# - RabbitMQ 传输速率加快?

erlang - 如何跨多个模块包含 .hrl 文件 rebar3

erlang - OTP - 添加 Couchbeam 作为依赖项 - ** 异常错误 : undefined function jsx:decode/1

docker - 如何使 docker 网络——使用管道添加的接口(interface)持久化

Azure DevOps 托管代理 : How to build into a container, 然后提取构建工件

java - 如何从整体部署中拆分 docker 文件

matlab - 如何从命令行向 Erlang 进程发送消息?