gpt4 book ai didi

scala - SBT:在 Docker 容器中进行构建时解决缓慢且失败

转载 作者:IT老高 更新时间:2023-10-28 21:39:13 27 4
gpt4 key购买 nike

我有一个简单的游戏! build.sbt;

中没有什么特别的应用程序
name := """project-name"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
jdbc,
javaJdbc,
javaEbean,
"mysql" % "mysql-connector-java" % "5.1.38",
cache,
ws,
"com.googlecode.libphonenumber" % "libphonenumber" % "7.1.0"
)

// string metrics
libraryDependencies += "com.rockymadden.stringmetric" %% "stringmetric-core" % "0.27.4"

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

Dockerfile 中,我正在尝试通过 activator distsbt dist 构建此应用程序的可执行文件激活阶段命令。

当我在我的计算机上运行时,上述所有功能都完美无缺。但是,当我在 docker 容器中运行完全相同的命令时,我注意到了;

  • SBT 需要很长时间才能解决依赖关系,而且速度很慢通过依赖项列表。
  • 构建失败并显示以下内容:sbt.ResolveException:下载失败:
    org.scalaz#scalaz-core_2.10;7.0.2!scalaz-core_2.10.jar(bundle)

我怀疑这是与 SBT 或特定于 Docker 容器有关的错误。有人见过这个吗?

最佳答案

Mounting the .ivy2 and .sbt directories in the container显着提高编译速度:

-v ~/.sbt:/root/.sbt -v ~/.ivy2:/root/.ivy2

关于scala - SBT:在 Docker 容器中进行构建时解决缓慢且失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34925302/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com