Don't jarjar anymore.
This commit is contained in:
parent
44eb9d1d9c
commit
307b3427e8
77 changed files with 6359 additions and 15 deletions
|
@ -0,0 +1,19 @@
|
|||
package dev.zontreck.ariaslib.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class EnvironmentUtils {
|
||||
public static boolean isRunningInsideDocker ( ) {
|
||||
if ( Files.exists ( Paths.get ( "/.dockerenv" ) ) )
|
||||
return true;
|
||||
try {
|
||||
Stream<String> str = Files.lines ( Paths.get ( "/proc/1/cgroup" ) );
|
||||
return str.anyMatch ( ln -> ln.contains ( "/docker" ) );
|
||||
} catch ( IOException e ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue