【问题标题】:Dockerize Spring Boot AppDockerize Spring Boot 应用程序
【发布时间】:2018-01-10 19:49:35
【问题描述】:

我正在研究 Spring Boot 应用程序的 Dockerization。

不幸的是,我无法获得一个有效的项目。 就连 Pivotal 的官方Tutorial Project 也不会启动。

命令.\mvnw install dockerfile:build抛出错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.886 s
[INFO] Finished at: 2017-08-03T11:20:52+02:00
[INFO] Final Memory: 34M/536M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.3.4:build (default-cli) on project gs-spring-boot-docker: Could not build image: com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.spotify.docker.client.messages.RegistryAuth: no String-argument constructor/factory method to deserialize from String value ('wincred')
[ERROR] at [Source: N/A; line: -1, column: -1] (through reference chain: java.util.LinkedHashMap["credsStore"])
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

有人有解决这个问题的方法吗?或者可以指出我正确的方向吗?

【问题讨论】:

  • 您可以使用mvn package 构建您的应用程序吗?当您在本地构建它时它会运行吗?你的 Dockerfile 是什么样的?
  • 我可以构建它并在本地运行它(作为 Spring Boot 应用程序运行)。 Dockerfile 就是 Pivot 教程中的 original
  • 这个例子对我有用;所以没有更多关于你的 pom 或 Dockerfile 的信息,我无能为力
  • 我没有改变 Dockerfile 和 pom。

标签: java spring maven docker


【解决方案1】:

在最近的 docker 更新中,他在 ~/.docker/config.json 中需要 auths 字段

这会在我的 Mac 上为我修复它。

    {
      "auths": {
        "https://index.docker.io/v1/": {}
      },
      "credsStore" : "osxkeychain",
      "credSstore" : "osxkeychain"
     }

【讨论】:

    猜你喜欢
    • 2021-11-17
    • 2019-11-27
    • 2022-10-21
    • 2016-10-14
    • 2018-06-06
    • 2023-03-12
    • 2019-06-17
    • 2022-07-08
    • 2019-08-31
    相关资源
    最近更新 更多