java - Dockerize Spring Boot 应用程序

标签 java spring maven docker

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

不幸的是,我无法获得有效的项目。 连官方Tutorial Project来自 Pivotal 的服务将无法启动。

命令 .\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

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

最佳答案

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

这在我的 Mac 上修复了这个问题。

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

关于java - Dockerize Spring Boot 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45480268/

相关文章:

java - 如何在 Groovy 中显示多字节字符?

java - Spring Boot 数据源设置

java - Cobertura 不识别经过充分测试的类

maven - 如何创建自己的 Maven 存储库?

maven-2 - 有没有办法让 Maven 为我的本地存储库的所有依赖项安装 javadoc?

java - 我可以在小程序中使用 PDFBox 吗?

java - Axis2 和 Web 服务

java - 如何制作直径为 3xp 的圆形的 javafx 按钮?

java - Hibernate 正则表达式验证字段不起作用

java - 为什么 Maven 依赖排除不会导致编译错误?