Skip to content

Commit

Permalink
Support Docker Desktop for building native executables
Browse files Browse the repository at this point in the history
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

Closes #37193

(cherry picked from commit 81818c7)
  • Loading branch information
zakkak authored and gsmet committed Nov 21, 2023
1 parent 279e385 commit da6ec38
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ private static boolean getRootlessStateFor(ContainerRuntime containerRuntime) {
final Predicate<String> stringPredicate;
// Docker includes just "rootless" under SecurityOptions, while podman includes "rootless: <boolean>"
if (containerRuntime == ContainerRuntime.DOCKER) {
stringPredicate = line -> line.trim().equals("rootless");
// 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");
} else {
stringPredicate = line -> line.trim().equals("rootless: true");
}
Expand Down

0 comments on commit da6ec38

Please sign in to comment.