gpt4 book ai didi

Scala SBT 设置 dockerRepository "Repository for publishing is not specified"

转载 作者:行者123 更新时间:2023-12-01 07:42:10 27 4
gpt4 key购买 nike

我正在尝试使用以下命令将 scala 构建发布到 docker 注册表:

./sbt "; set dockerRepository := Some(\"registryname/project\"); docker:publish"

我正在指定 dockerRepository 但在运行命令时它会抛出以下错误:

[error] You cannot push a "root" repository. Please rename your repository to <user>/<repo> (ex: <user>/example)
java.lang.RuntimeException: Repository for publishing is not specified.
[error] (all/*:publishConfiguration) Repository for publishing is not specified.
[error] (server/docker:publish) Nonzero exit value: 1
[error] (config/*:publishConfiguration) Repository for publishing is not specified.
[error] Total time: 63 s, completed 01/09/2015 10:48:04 AM

当我查看我的本地 docker registry 时,我可以看到它编译了 docker 镜像但没有为 docker registry 名称添加前缀:

docker images

REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
example 0.0.1 SNAPSHOT a6eb8942aa9f 8 minutes ago 1.136 GB

所以它似乎没有接受我在命令中设置的 dockerRepository 变量,这也在构建日志中:

[15:32:58][Step 4/5] [info] Loading project definition from /build/project
[15:33:01][Step 4/5] [info] Set current project to example (in build file:/build/)
[15:33:06][Step 4/5] [info] Defining {.}/*:dockerRepository
[15:33:06][Step 4/5] [info] The new value will be used by no settings or tasks.
[15:33:06][Step 4/5] [info] Reapplying settings...

最佳答案

来自 Alex Laverty 的评论:

build.sbt中:

ThisBuild 中的 dockerRepository := Some("docker.io")

或在带有子模块的项目中:

lazy val server = (project in file("server"))
.settings(dockerRepository := Some("docker.io"),
dockerUsername := Some("pame"),
...)

然后:

sbt docker:publish

关于Scala SBT 设置 dockerRepository "Repository for publishing is not specified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32322068/

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