无法在基于Alpine的Docker容器中运行Play framework应用程序

无法在基于Alpine的Docker容器中运行Play framework应用程序,docker,sbt,sbt-native-packager,Docker,Sbt,Sbt Native Packager,我有一个在默认(由sbt提供)docker base映像上运行的Play应用程序。我想将此应用程序切换到基于Alpine的图像 我补充道 enablePlugins(AshScriptPlugin) dockerBaseImage := "openjdk:8-jre-alpine" 到我的build.sbt文件。尝试运行此容器时,出现以下错误: bin/foo-service: line 51: /opt/docker/lib/foo-service.foo-service-1.0.40-la

我有一个在默认(由sbt提供)docker base映像上运行的Play应用程序。我想将此应用程序切换到基于Alpine的图像

我补充道

enablePlugins(AshScriptPlugin)
dockerBaseImage := "openjdk:8-jre-alpine"
到我的
build.sbt
文件。尝试运行此容器时,出现以下错误:

bin/foo-service: line 51: /opt/docker/lib/foo-service.foo-service-1.0.40-launcher.jar: Permission denied
bin/foo-service: line 56: is_cygwin: not found
Unrecognized option: -J-Xms512M
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

跟踪此问题时已经存在问题。这个问题是因为在bash脚本的附加部分中添加了一些不符合ash的内容

建议的一种解决方法()是将其添加到
build.sbt

bashScriptExtraDefines := List(
    """addJava "-Duser.dir=$(realpath "$(cd "${app_home}/.."; pwd -P)")""""
)