Skip to content

Commit 875aee9

Browse files
committed
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 #37242
1 parent 3f87117 commit 875aee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/runtime/src/main/java/io/quarkus/runtime/util/ContainerRuntimeUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private static boolean getRootlessStateFor(ContainerRuntime containerRuntime) {
194194
// We also treat Docker Desktop as "rootless" since the way it binds mounts does not
195195
// transparently map the host user ID and GID
196196
// see https://docs.docker.com/desktop/faqs/linuxfaqs/#how-do-i-enable-file-sharing
197-
stringPredicate = line -> line.trim().equals("rootless") || line.contains("desktop-linux");
197+
stringPredicate = line -> line.trim().equals("rootless") || line.contains("Docker Desktop") || line.contains("desktop-linux");
198198
} else {
199199
stringPredicate = line -> line.trim().equals("rootless: true");
200200
}

0 commit comments

Comments
 (0)