Description
Running spring-boot:build-image
fails when the builder configured in the spring-boot-maven-plugin
is not in a public repository, with message:
Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.4.2:build-image failed: Docker API call to '/var/run/docker.sock/v1.41/images/create?fromImage=my-registry/my-builder:latest' failed with status code 500 "Internal Server Error" and message "Head "https://my-registry/v2/my-builder/manifests/latest": no basic auth credentials"
Docker is configured with a credential helper (ecr-login + aws sso login for me) so docker pull/push work fine, but I suspect that direct API calls to the socket don't interact with the credential helper. Using docker login also doesn't work, nor does pulling the image beforehand.
pack build
works fine, but I'd rather use a maven plugin than coordinate the build between maven and an external tool.
I need a different builder because of #43716.
Possibly related to #25898.
Steps to reproduce:
- create a private registry (e.g. on aws ecr)
- download the appropriate credential helper and put it on your PATH
- configure docker to use the credential helper (
credHelpers
section of.docker/config.json
) - login if required (e.g. aws sso login)
- build and push a builder to the private registry
- create an empty spring boot project and override the image builder parameter of the spring boot maven plugin with your builder
- run
mvn spring-boot:build-image