我如何通过 ssh spring shell cli 访问

How can i access through ssh spring shell cli

我正在尝试使用 spring-shell 库实现一个简单的 cli 应用程序(linux docker 图像中的可执行 jar 文件 运行)。在我使用 "docker run -it -p 8080:8080 springshelldemo" 命令启动 Docker 图像后,我的 spring-shell 应用程序启动并且 cli 在 cmd 中可用。我如何使用 docker exec 命令(或其他更好的方法)从第二个 cmd 访问此 spring-shell cli? 我需要这个才能让我的应用程序同时可供 1 个以上的用户使用。

我找到了这个问题的答案。在 spring shell https://github.com/fonimus/ 之上有一个很棒的库,它为您提供了 ssh 功能,并且通过适当的 docker 运行 文件命令,您可以访问 spring shell 通过 ssh 并提供所有功能。