I am trying to execute a docker command from within Java. The docker command needs to be executed in the specified directory.
I found this for executing an external command.
public Process exec(String command, String[] envp, File dir) throws IOException
I am unable to understand what exactly does this envp String array is used for? The documentation reads as:
envp - array of strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
But I am unable to understand what it exactly means in the documentation. Could someone explain it with an example? What exactly do you need to pass as an argument here.
P.s.: I am using a *nix environment for dev/deployment.