Description

After Docker Desktop upgrade from 4.30.0 to 4.31.1 spring-boot:build-image started failing with: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.2.5:build-image (default-cli) on project siva-webapp: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.2.5:build-image failed: Illegal char <:> at index 5: npipe:////./pipe/dockerDesktopLinuxEngine

Versions

OS: Windows 11 Java: 17 Docker desktop (for windows): :white_check_mark: 4.30.0 :x: 4.31.0 :x: 4.31.1 Spring Boot (with Docker Desktop 4.31.1): :x: 3.2.5 :x: 3.3.0 :x: 3.3.1

Reproduction

Sample app: DD4J-test-application Command: ./mvnw spring-boot:build-image -DskipTests

Comment From: wilkinsona

Thanks for the report. Can you please share the complete stack trace? If it's not logged by default, I think it should be if you run Maven with -X.

Comment From: Sedemicra

But of course. Stack trace from running with -X:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.1:build-image (default-cli) on project dd4j-test-application: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.1:build-image failed: Illegal char <:> at index 5: npipe:////./pipe/dockerDesktopLinuxEngine -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.1:build-image (default-cli) on project dd4j-test-application: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.1:build-image failed: Illegal char <:> at index 5: npipe:////./pipe/dockerDesktopLinuxEngine
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.1:build-image failed: Illegal char <:> at index 5: npipe:////./pipe/dockerDesktopLinuxEngine
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: npipe:////./pipe/dockerDesktopLinuxEngine
    at sun.nio.fs.WindowsPathParser.normalize (WindowsPathParser.java:182)
    at sun.nio.fs.WindowsPathParser.parse (WindowsPathParser.java:153)
    at sun.nio.fs.WindowsPathParser.parse (WindowsPathParser.java:77)
    at sun.nio.fs.WindowsPath.parse (WindowsPath.java:92)
    at sun.nio.fs.WindowsFileSystem.getPath (WindowsFileSystem.java:232)
    at java.nio.file.Path.of (Path.java:147)
    at java.nio.file.Paths.get (Paths.java:69)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.open (NamedPipeSocket.java:64)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.<init> (NamedPipeSocket.java:56)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.get (NamedPipeSocket.java:100)
    at org.springframework.boot.buildpack.platform.docker.transport.LocalHttpClientTransport$LocalConnectionSocketFactory.createSocket (LocalHttpClientTransport.java:128)
    at org.apache.hc.client5.http.socket.ConnectionSocketFactory.createSocket (ConnectionSocketFactory.java:67)
    at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:163)
    at org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.connect (BasicHttpClientConnectionManager.java:399)
    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint (InternalExecRuntime.java:162)
    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint (InternalExecRuntime.java:172)
    at org.apache.hc.client5.http.impl.classic.ConnectExec.execute (ConnectExec.java:142)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute (ProtocolExec.java:192)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute (HttpRequestRetryExec.java:113)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute (ContentCompressionExec.java:152)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.RedirectExec.execute (RedirectExec.java:116)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute (InternalHttpClient.java:170)
    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute (CloseableHttpClient.java:87)
    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute (CloseableHttpClient.java:55)
    at org.apache.hc.client5.http.classic.HttpClient.executeOpen (HttpClient.java:183)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:147)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:142)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.post (HttpClientTransport.java:96)
    at org.springframework.boot.buildpack.platform.docker.DockerApi$ImageApi.pull (DockerApi.java:186)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.pullImage (Builder.java:240)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.fetchImage (Builder.java:224)
    at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:103)
    at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:253)
    at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:243)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

Comment From: wilkinsona

Thanks. I'm trying to determine what's changed in Docker Desktop 4.31. There's mention of npipe: URLs as far back as 4.17. Can you please share the output of docker context inspect with Docker Desktop 4.30 and 4.31?

Comment From: Sedemicra

docker context inspect with Docker Desktop 4.30.0

[
    {
        "Name": "default",
        "Metadata": {},
        "Endpoints": {
            "docker": {
                "Host": "npipe:////./pipe/docker_engine",
                "SkipTLSVerify": false
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "\u003cIN MEMORY\u003e",
            "TLSPath": "\u003cIN MEMORY\u003e"
        }
    }
]

docker context inspect with Docker Desktop 4.31.1

[
    {
        "Name": "desktop-linux",
        "Metadata": {
            "Description": "Docker Desktop"
        },
        "Endpoints": {
            "docker": {
                "Host": "npipe:////./pipe/dockerDesktopLinuxEngine",
                "SkipTLSVerify": false
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "C:\\Users\\<username>\\.docker\\contexts\\meta\\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e",
            "TLSPath": "C:\\Users\\<username>\\.docker\\contexts\\tls\\fe9c6bd7a66301f49ca9b6a70b217107cd1284598bfc254700c989b916da791e"
        }
    }
]

Comment From: wilkinsona

Thanks again.

Both contexts look fine in that they both have npipe: hosts. Something that will cause a problem is the change from docker_engine to dockerDesktopLinuxEngine as our ResolvedDockerHost class defaults to the former in the absence of any other configuration. That's not the cause of your problem, but is something that we'll have to look at.

I suspect that your environment's changed when you upgraded to Docker Desktop 4.31 such that ResolvedDockerHost.from is now returning an instance with a different address. Can you please share any DOCKER_* environment variables that are configured when using Docker Desktop 4.31? It would also be interesting to see the same from Docker Desktop 4.30.

I think you should be able to work around the problem by configuring the host explicitly. Something like this (untested as I don't have easy access to a Windows box):

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <docker>
            <host>//./pipe/dockerDesktopLinuxEngine</host>
        </docker>
    </configuration>
</plugin>

Comment From: pre-martin

Same here: After upgrading Docker to 4.31.1 (from 4.30.x), "build-image" fails. The above mentioned workaround works for me (with gradle):

tasks.bootBuildImage {
    docker {
        host = "//./pipe/dockerDesktopLinuxEngine"
    }
}

Comment From: abhi11101

Worked with Maven

Comment From: michaeli1007

Thanks a lot!

Comment From: wilkinsona

Can someone for whom this doesn't work without explicitly configuring the host please share the details of their DOCKER_* environment variables with Docker Desktop 4.30 and 4.31?

Comment From: Sedemicra

Can confirm, that the workaround of configuring the host explicitly works. @wilkinsona, I'm a bit in a loss regarding your request of DOCKER_* environment variables. Since there are no such variables among my system env variables I'm not sure I understand correctly what you mean.

Comment From: wilkinsona

Thanks, @Sedemicra. That you do not have any DOCKER_* environment variables is useful information.

Comment From: pre-martin

Same here: set | grep -i docker does not output anything (expect the Windows "PATH" variable).

Comment From: philwebb

I've replicated this locally. I think the issue is that C:\Users\<user>\.docker\contexts\meta\<hash>\meta.json now contains a host:

{
  "Name": "desktop-linux",
  ...
  "Endpoints": {
    "docker": {
      "Host": "npipe:////./pipe/dockerDesktopLinuxEngine",
      "SkipTLSVerify": false
    }
  }
}

Comment From: philwebb

Reopening because manually testing with Windows and I now get:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.321 s
[INFO] Finished at: 2024-06-25T13:27:01-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.2-SNAPSHOT:build-image (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.2-SNAPSHOT:build-image failed: Connection to the Docker daemon at 'npipe:////./pipe/dockerDesktopLinuxEngine' failed with error "\\.\pipe\dockerDesktopLinuxEngine"; ensure the Docker daemon is running and accessible -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.2-SNAPSHOT:build-image (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.2-SNAPSHOT:build-image failed: Connection to the Docker daemon at 'npipe:////./pipe/dockerDesktopLinuxEngine' failed with error "\\.\pipe\dockerDesktopLinuxEngine"; ensure the Docker daemon is running and accessible
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.2-SNAPSHOT:build-image failed: Connection to the Docker daemon at 'npipe:////./pipe/dockerDesktopLinuxEngine' failed with error "\\.\pipe\dockerDesktopLinuxEngine"; ensure the Docker daemon is running and accessible
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.springframework.boot.buildpack.platform.docker.transport.DockerConnectionException: Connection to the Docker daemon at 'npipe:////./pipe/dockerDesktopLinuxEngine' failed with error "\\.\pipe\dockerDesktopLinuxEngine"; ensure the Docker daemon is running and accessible
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:160)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:142)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.post (HttpClientTransport.java:96)
    at org.springframework.boot.buildpack.platform.docker.DockerApi$ImageApi.pull (DockerApi.java:186)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.pullImage (Builder.java:240)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.fetchImage (Builder.java:224)
    at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:103)
    at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:253)
    at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:243)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: java.nio.file.NoSuchFileException: \\.\pipe\dockerDesktopLinuxEngine
    at sun.nio.fs.WindowsException.translateToIOException (WindowsException.java:85)
    at sun.nio.fs.WindowsException.rethrowAsIOException (WindowsException.java:96)
    at sun.nio.fs.WindowsChannelFactory.newAsynchronousFileChannel (WindowsChannelFactory.java:209)
    at sun.nio.fs.WindowsFileSystemProvider.newAsynchronousFileChannel (WindowsFileSystemProvider.java:146)
    at java.nio.channels.AsynchronousFileChannel.open (AsynchronousFileChannel.java:259)
    at java.nio.channels.AsynchronousFileChannel.open (AsynchronousFileChannel.java:323)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.open (NamedPipeSocket.java:64)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.<init> (NamedPipeSocket.java:56)
    at org.springframework.boot.buildpack.platform.socket.NamedPipeSocket.get (NamedPipeSocket.java:100)
    at org.springframework.boot.buildpack.platform.docker.transport.LocalHttpClientTransport$LocalConnectionSocketFactory.createSocket (LocalHttpClientTransport.java:130)
    at org.apache.hc.client5.http.socket.ConnectionSocketFactory.createSocket (ConnectionSocketFactory.java:67)
    at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:163)
    at org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.connect (BasicHttpClientConnectionManager.java:399)
    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint (InternalExecRuntime.java:162)
    at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint (InternalExecRuntime.java:172)
    at org.apache.hc.client5.http.impl.classic.ConnectExec.execute (ConnectExec.java:142)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute (ProtocolExec.java:192)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute (HttpRequestRetryExec.java:113)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute (ContentCompressionExec.java:152)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.RedirectExec.execute (RedirectExec.java:116)
    at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute (ExecChainElement.java:51)
    at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute (InternalHttpClient.java:170)
    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute (CloseableHttpClient.java:87)
    at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute (CloseableHttpClient.java:55)
    at org.apache.hc.client5.http.classic.HttpClient.executeOpen (HttpClient.java:183)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:147)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.execute (HttpClientTransport.java:142)
    at org.springframework.boot.buildpack.platform.docker.transport.HttpClientTransport.post (HttpClientTransport.java:96)
    at org.springframework.boot.buildpack.platform.docker.DockerApi$ImageApi.pull (DockerApi.java:186)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.pullImage (Builder.java:240)
    at org.springframework.boot.buildpack.platform.build.Builder$ImageFetcher.fetchImage (Builder.java:224)
    at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:103)
    at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:253)
    at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:243)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

Comment From: philwebb

Ignore me. Docker had crashed. The fix appears to work.

Comment From: codetheorist

One more occurrence and one more time the workaround fixed the issue. I've have no Docker environmental variables setup in my system.

On Windows Ad Machine™, latest update.

Comment From: philwebb

@codetheorist If you have the chance, can you try the latest SNAPSHOT to see if the work-around is no longer needed.

Comment From: sawamura722

so how do i fix this problem. my maven version is 3.31 docker desktop is 4.31.1 . I encounter this problem too. UPDATE : I tried downgrading docker desktop version to 4.30.0 and it works thanks a lot guys

Comment From: wilkinsona

@sawamura722 there's a workaround for Maven that should work with Docker Desktop 4.31.

Comment From: teoim

Hey guys, I also have this issue. The workaround configuration solves it, thanks! I'm on Win 11, Docker Desktop 4.32.0, Maven 3.9.5. No DOCKER_* environment variables for me as well.

Comment From: kartikdhiman

@wilkinsona thank you for the workaround it worked with the maven.

I am at Docker Desktop v4.32 it is reproducible at this version too. So should we expect a fix from team at Docker Desktop ?

Comment From: wilkinsona

No, I don't expect one. The next versions of Spring Boot (3.2.8 and 3.3.2) will cope with the breaking change in Docker Desktop. Until then, please continue to use the workaround.

Comment From: paulchambers

You can work around this in Docker by going to Builds/"Builder settings" and clicking the ... menu on the "default" builder and choosing use.

Unfortunately it resets back to the "desktop-linux" builder each time you restart docker.

docker context output for the two builders:

{
    "Name": "default",
    "Metadata": {},
    "Endpoints": {
        "docker": {
            "Host": "npipe:////./pipe/docker_engine",
            "SkipTLSVerify": false
        }
    }
},

{
    "Name": "desktop-linux",
    "Metadata": {
        "Description": "Docker Desktop",
    },
    "Endpoints": {
        "docker": {
            "Host": "npipe:////./pipe/dockerDesktopLinuxEngine",
            "SkipTLSVerify": false
        }
    }
}

Comment From: shineeng

Unfortunately it resets back to the "desktop-linux" builder each time you restart docker.

that's why this is so annoying. The workaround works for me as well, but it has to be re-applied at each restart. If I got it right, docker desktop won't be fixing this, a new spring-boot/mvn compiler will be needed.

Comment From: wilkinsona

A fix has already been made in Spring Boot (hence this issue being closed as completed). It will be released next week.

Comment From: likeyellow

Thanks again.

Both contexts look fine in that they both have npipe: hosts. Something that will cause a problem is the change from docker_engine to dockerDesktopLinuxEngine as our ResolvedDockerHost class defaults to the former in the absence of any other configuration. That's not the cause of your problem, but is something that we'll have to look at.

I suspect that your environment's changed when you upgraded to Docker Desktop 4.31 such that ResolvedDockerHost.from is now returning an instance with a different address. Can you please share any DOCKER_* environment variables that are configured when using Docker Desktop 4.31? It would also be interesting to see the same from Docker Desktop 4.30.

I think you should be able to work around the problem by configuring the host explicitly. Something like this (untested as I don't have easy access to a Windows box):

<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <docker> <host>//./pipe/dockerDesktopLinuxEngine</host> </docker> </configuration> </plugin>

It was work for me. Thanks.

Comment From: shineeng

A fix has already been made in Spring Boot (hence this issue being closed as completed). It will be released next week.

I can confirm that in our case updating to spring-boot 3.3.2 solved the issue with no other workaround.

Thanks everyone

Comment From: itzelito

Thanks again.

Both contexts look fine in that they both have npipe: hosts. Something that will cause a problem is the change from docker_engine to dockerDesktopLinuxEngine as our ResolvedDockerHost class defaults to the former in the absence of any other configuration. That's not the cause of your problem, but is something that we'll have to look at.

I suspect that your environment's changed when you upgraded to Docker Desktop 4.31 such that ResolvedDockerHost.from is now returning an instance with a different address. Can you please share any DOCKER_* environment variables that are configured when using Docker Desktop 4.31? It would also be interesting to see the same from Docker Desktop 4.30.

I think you should be able to work around the problem by configuring the host explicitly. Something like this (untested as I don't have easy access to a Windows box):

<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <docker> <host>//./pipe/dockerDesktopLinuxEngine</host> </docker> </configuration> </plugin>

Lifesaver thanks!!!

Comment From: jerrycaffe

In my case resetting docker desktop to factory settings worked for me as I use MacBook pro m3