Closed coemgenuslcp closed 1 year ago
The root directory for config data is determined by function userConfigDirectory in DirectoryConfig.java.
Here are the relevant Java statements:
} else if ( OSName.isUnixOS() ) {
path = System.getenv ( "XDG_CONFIG_HOME" );
if ( path == null ) {
path = OSDirectories.USER_HOME_DIRECTORY + "/.config";
}
As can be seen: The config root directory is retrieved from the OS environment variable XDG_CONFIG_HOME. If this variable is not defined then OSDirectories.USER_HOME_DIRECTORY + "/.config"
is used. OSDirectories.USER_HOME_DIRECTORY
is defined as follows:
USER_HOME_DIRECTORY = Path.of ( System.getProperty ( "user.home" ) );
It seems that inside your container context:
XDG_CONFIG_HOME
is not definedSystem.getProperty ( "user.home" )
returns ?
... which is the reason why the path evaluates to ?/.config
.
Hence I suggest to explicitly specify the config root directory by defining OS environment variable XDG_CONFIG_HOME
in your Docker config file.
Please let me know if this solves your problem.
PS: To avoid this situation in the future, all functions in DirectoryConfig.java using OSDirectories.USER_HOME_DIRECTORY
(i.e. System.getProperty ( "user.home" )
) should check this value. If it is ?
, then there should be a helpful message displayed in the terminal, so that the user knows how to solve the problem.
When I run PMLC 3.0.0 inside a Docker container on Linux, the resources directory gets written to
?/.config
. It may be something in how the resources directory string determines home or wherever, when it is inside the container context.The
?
folder appears to be created relative to the current directory. As a side effect, if you mount the current directory to the container andWORKDIR
into it inside the Dockerfile, the?
folder with the.config/PML
resources subdirectory will be generated inside the current directory, withroot:root
as the owner.