Skip to content

spring-boot-maven-plugin:build-image fails on Docker Desktop / Windows due missing authentication #36671

Closed as not planned
@eidottermihi

Description

@eidottermihi

When running the build-image goal of spring-boot-maven-plugin on Windows with Docker Desktop, the build fails when the plugin tries to pull the buildpacks builder image via Docker API.

[INFO] --- spring-boot-maven-plugin:3.1.2:build-image-no-fork (build-image) @ appswitcher-server ---
[INFO] Building image 'docker.io/itatm/appswitcher-server:1.0.3-SNAPSHOT'
[INFO]
[INFO]  > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.199 s
[INFO] Finished at: 2023-08-02T10:51:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.2:build-image-no-fork (build-image) on project appswitcher-server: 
  Execution build-image of goal org.springframework.boot:spring-boot-maven-plugin:3.1.2:build-image-no-fork failed: 
    Docker API call to 'localhost/v1.24/images/create?fromImage=docker.io%2Fpaketobuildpacks%2Fbuilder%3Abase' failed with status code 407 "Proxy Authentication Required" -> [Help 1]

(full maven debug log see attachment)

This seems to be related to an authentication issue, because the docker.log (located %LOCALAPPDATA%\Docker\log\vm) contains this error:

[2023-08-02T08:51:59.764710000Z][docker][I] [2023-08-02T08:51:59.764357000Z][lifecycle-server][I] missing X-Registry-Auth header
[2023-08-02T08:51:59.764852000Z][docker][I] [2023-08-02T08:51:59.764593100Z][lifecycle-server][I] must be logged in to call /v1.24/images/create?fromImage=docker.io%2Fpaketobuildpacks%2Fbuilder%3Abase

To debug this issue further I manually issued the problematic Docker API call with cURL:

$ curl -X POST -v http://localhost:2375/v1.24/images/create?fromImage=docker.io%2Fpaketobuildpacks%2Fbuilder%3Atiny
* Connected to localhost (::1) port 2375 (#0)
> POST /v1.24/images/create?fromImage=docker.io%2Fpaketobuildpacks%2Fbuilder%3Atiny HTTP/1.1
> Host: localhost:2375
> User-Agent: curl/7.73.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 407 Proxy Authentication Required
< Content-Type: text/plain; charset=utf-8
< Date: Wed, 02 Aug 2023 08:11:10 GMT
< X-Content-Type-Options: nosniff
< Transfer-Encoding: chunked
<
{ [32 bytes data]
100    26    0    26    0     0   1238      0 --:--:-- --:--:-- --:--:--  1300Please run 'docker login'

* Connection #0 to host localhost left intact

As the response body of the problematic call contains Please run 'docker login' I also checked that my Docker config.json contains the relevant data:

{
	"auths": {
		"ghcr.io": {},
		"https://index.docker.io/v1/": {}
	},
	"credsStore": "wincred"
}

So somehow this is also related or blocked by #25898

Pulling the image via Docker CLI works without a problem:

$ docker pull docker.io/paketobuildpacks/builder:base
base: Pulling from paketobuildpacks/builder
Digest: sha256:17ea21162ba8c7717d3ead3ee3836a368aced7f02f2e59658e52029bd6d149e7
Status: Downloaded newer image for paketobuildpacks/builder:base
docker.io/paketobuildpacks/builder:base

My environment:

  • Windows 10 22H2 (Build 19045.3208)
  • Docker Desktop v4.19.0
  • Spring Boot 3.1.2

full_log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions