mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 15:37:54 -05:00
add a fallback for docker detection on Mac (#6356)
Signed-off-by: garyschulte <garyschulte@gmail.com>
This commit is contained in:
@@ -33,6 +33,8 @@ public class DockerDetector implements NatMethodDetector {
|
||||
return stream
|
||||
.filter(line -> line.contains("/docker"))
|
||||
.findFirst()
|
||||
// fallback to looking for /.dockerenv in case we are running on Docker for Mac
|
||||
.or(() -> Optional.ofNullable(Files.exists(Paths.get("/.dockerenv")) ? "docker" : null))
|
||||
.map(__ -> NatMethod.DOCKER);
|
||||
} catch (IOException e) {
|
||||
return Optional.empty();
|
||||
|
||||
Reference in New Issue
Block a user