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
- Allow 'npipe://' prefix in Docker host address Update `LocalHttpClientTransport` to support explicit `npipe://` prefix in the host name. This is the format used in the Docker config from v4.31.1 onwa... — committed to spring-projects/spring-boot by philwebb 2 years ago
- Add "configuration" for spring-boot-maven-plugin to fix this issue: https://github.com/spring-projects/spring-boot/issues/41199#issuecomment-2182939925 — committed to rujche/java-runtime-for-azure by rujche 2 years ago
Thanks again.
Both contexts look fine in that they both have
npipe:hosts. Something that will cause a problem is the change fromdocker_enginetodockerDesktopLinuxEngineas ourResolvedDockerHostclass 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.fromis now returning an instance with a different address. Can you please share anyDOCKER_*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):
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):
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:
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.
Lifesaver thanks!!!
Worked with Maven