From 5336193a00f08f7a787a4ec6fc46ae66b4d2cf5b Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 28 Nov 2023 22:19:25 +0200 Subject: [PATCH] Improve Docker Desktop detection During some experiments I noticed that when setting DOCKER_HOST, `docker info` no longer reports the context as `desktop-linux`. Looking for "Docker Desktop" as the docker server operating system seems more reliable. I am keeping the `desktop-linux` filter as a fallback nevertheless. Improves https://github.com/quarkusio/quarkus/pull/37242 --- .../java/io/quarkus/runtime/util/ContainerRuntimeUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/util/ContainerRuntimeUtil.java b/core/runtime/src/main/java/io/quarkus/runtime/util/ContainerRuntimeUtil.java index 607ead4f24980..42cc489ec9988 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/util/ContainerRuntimeUtil.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/util/ContainerRuntimeUtil.java @@ -194,7 +194,8 @@ private static boolean getRootlessStateFor(ContainerRuntime containerRuntime) { // We also treat Docker Desktop as "rootless" since the way it binds mounts does not // transparently map the host user ID and GID // see https://docs.docker.com/desktop/faqs/linuxfaqs/#how-do-i-enable-file-sharing - stringPredicate = line -> line.trim().equals("rootless") || line.contains("desktop-linux"); + stringPredicate = line -> line.trim().equals("rootless") || line.contains("Docker Desktop") + || line.contains("desktop-linux"); } else { stringPredicate = line -> line.trim().equals("rootless: true"); }