【问题标题】:Cannot keep the scala application up and running on docker无法让 scala 应用程序在 docker 上启动并运行
【发布时间】:2017-12-03 16:05:50
【问题描述】:

我正在尝试在 docker 上部署一个 scala 应用程序,但服务器会立即启动和停止,并在控制台中显示以下日志,

---(运行应用程序,启用自动重新加载)---

[info] p.c.s.NettyServer - 在 /0:0:0:0:0:0:0:0:9002 上侦听 HTTP

(服务器已启动,使用 Ctrl+D 停止并返回控制台...)

[info] p.c.s.NettyServer - 停止服务器...

我在 docker 上使用以下命令启动服务器, activator -Dsbt.override.build.repos=true -Dsbt.repository.config=./repositories -Dsbt.log.noformat=true clean coverage "run 9002" &

你们知道如何让服务器在容器被杀死之前停止吗?

【问题讨论】:

标签: scala docker netty dockerfile


【解决方案1】:

您是否在命令中包含&?这会将命令分叉到后台,然后容器就退出了。您可以通过删除& 来解决这个问题。否则,需要更多信息。

您能否提供Dockerfile 包括用于启动容器的完整命令?此外,总是发布事物的版本是个好主意(Scala、Docker 等的版本)。

【讨论】:

  • 我可以通过先编译应用程序然后部署应用程序来解决这个问题 1. activator -Dsbt.override.build.repos=true -Dsbt.repository.config=./repositories -Dsbt .log.noformat=true clean coverage dist 2. bin/test-project -Dhttp.port=9002 &
猜你喜欢
  • 2015-03-25
  • 2019-11-21
  • 2021-12-22
  • 2020-01-27
  • 1970-01-01
  • 2021-01-14
  • 1970-01-01
  • 2017-06-18
  • 2014-04-20
相关资源
最近更新 更多