我在windows上,这是插件配置:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<container>
<ports>
<port>8080</port>
</ports>
<format>OCI</format>
</container>
</configuration>
</plugin>这是我运行的命令:
.\mvnw clean install jib:dockerBuild -Dimage=fullstack:v1无论我做什么,这都是我一直犯的错误:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project SpringBootFullStack: Build
to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/eclipse-temurin' are set up correc
tly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized f
or help: Unauthorized for registry-1.docker.io/library/eclipse-temurin: 401 Unauthorized
[ERROR] {"details":"incorrect username or password"}
[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我该怎么做呢?我读过关于jib github回购的关于身份验证的文档,但我并不真正理解如何进行,并且感到不知所措。
更新
我运行了docker login,我得到:
Authenticating with existing credentials...
Login Succeeded但是错误仍然存在(我想我没有包括日志记录的某些部分,可能是:
[INFO] Using credentials from Docker config (C:\Users\david\.docker\config.json) for openjdk:17
[INFO] Executing tasks:
[INFO] [============ ] 40.0% complete
[INFO] > building image to Docker daemon
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.964 s
[INFO] Finished at: 2022-05-17T19:39:12+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project SpringBootFullStack: Build
to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/openjdk' are set up correctly. See
Unauthorized for registry-1.docker.io/library/openjdk: 401 Unauthorized
[ERROR] {"details":"incorrect username or password"}
[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更新2
这也是为了获取用户名和密码而引用的文件日志的内容:
{
"auths": {
"https://index.docker.io/v1/": {}
},
"credsStore": "desktop"
}更新3
经过两天的尝试,我决定寻找其他可以做同样工作的东西:https://spring.io/guides/gs/spring-boot-docker/,用它,工作在10分钟内就完成了。生活真的很疯狂
发布于 2022-08-13 15:02:45
只需从docker文件中删除credsStore属性即可。您将在您的用户主页dir中找到config.json。
路径是:$USER/.docker/config.json,假设文件包含以下内容,
{
"auths": {
"https://index.docker.io/v1/": {}
},
"credsStore": "desktop"
}现在删除行:"credsStore":“桌面”
因此,该文件现在将包含以下内容
{
"auths": {
"https://index.docker.io/v1/": {}
}
}发布于 2022-05-26 15:34:00
{"details":"incorrect username or password"}服务器的响应是明确的。证书是给服务器的,它说它们是错误的。
事实上,Jib确实从Docker config.json文件中检索了一些凭据(可能不起作用):
[INFO] Using credentials from Docker config (C:\Users\david\.docker\config.json) for openjdk:17尝试完全清空config.json,或者只删除该文件。特别是,删除"https://index.docker.io/v1/"和credsStore的条目。
发布于 2022-05-19 10:46:12
我在Mac上也有过同样的问题。我找到了两种解决问题的方法:
<configuration>
...
<from>
<image>aws_account_id.dkr.ecr.region.amazonaws.com/my-base-image</image>
<auth>
<username>my_username</username>
<password>my_password</password>
</auth>
</from>
<to>
<image>gcr.io/my-gcp-project/my-app</image>
<auth>
<username>${env.REGISTRY_USERNAME}</username>
<password>${env.REGISTRY_PASSWORD}</password>
</auth>
</to>
...
</configuration>https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/README.md#auth-object
Credential Manager或查找其他凭据存储。另外。在我研究的时候,我发现了一些改变的建议:
"credsStore": "desktop" -> "credStore": "desktop"但这对我没用。
https://stackoverflow.com/questions/72277087
复制相似问题