Using bootBuildImage with a private Docker repository on Windows 10

怎甘沉沦 提交于 2021-02-20 04:46:07

问题


I am trying to use bootBuildImage on Windows 10 (Docker is running in WSL2 mode) and when I set up in build.gradle

group = "repo.trajano.net"
bootBuildImage {
    builder = "${project.group}/${project.name}"
}

I found a couple of things that look incorrect

d:\dh\template-ms>gradlew bootBuildImage

> Task :bootBuildImage FAILED
Building image 'docker.io/library/template-ms:latest'

 > Pulling builder image 'repo.trajano.net/template-ms:latest' ..................................................

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> Docker API call to 'localhost/v1.24/images/create?fromImage=repo.trajano.net%2Ftemplate-ms%3Alatest' failed with status code 500 "Internal Server Error" and message "Get https://repo.trajano.net/v2/template-ms/manifests/latest: no basic auth credentials"

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
5 actionable tasks: 4 executed, 1 up-to-date

d:\dh\template-ms>gradlew bootBuildImage

I am able to pull images from the Docker command line using docker pull with no issues.

I tried using the snapshot versions of the plugin and it still fails.

I am running Sonatype Nexus as my repository

来源:https://stackoverflow.com/questions/62935871/using-bootbuildimage-with-a-private-docker-repository-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!