spring-boot: build-image failures after docker desktop update with 'Illegal char <:> at index 5: npipe:////'

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): ✅ 4.30.0 ❌ 4.31.0 ❌ 4.31.1 Spring Boot (with Docker Desktop 4.31.1): ❌ 3.2.5 ❌ 3.3.0 ❌ 3.3.1

Reproduction

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 29 (12 by maintainers)

Commits related to this issue

Most upvoted comments

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>

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"
    }
}

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
        }
    }
}

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

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.

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

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.

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!!!

Worked with Maven