Skip to content

Commit

Permalink
Use unsecure entropy source in docker packaging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Jan 6, 2025
1 parent f7444ae commit 02de815
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
*/
public class DockerRun {

// Use less secure entropy source to avoid hanging when generating certificates
private static final String DEFAULT_JAVA_OPTS = "-Djava.security.egd=file:/dev/urandom";

private Distribution distribution;
private final Map<String, String> envVars = new HashMap<>();
private final Map<Path, Path> volumes = new HashMap<>();
Expand Down Expand Up @@ -112,6 +115,13 @@ String build() {
// Limit container memory
cmd.add("--memory " + memory);

// Add default java opts
if (this.envVars.containsKey("CLI_JAVA_OPTS")) {
this.envVars.put("CLI_JAVA_OPTS", this.envVars.get("CLI_JAVA_OPTS") + " " + DEFAULT_JAVA_OPTS);
} else {
this.envVars.put("CLI_JAVA_OPTS", DEFAULT_JAVA_OPTS);
}

this.envVars.forEach((key, value) -> cmd.add("--env " + key + "=\"" + value + "\""));

// Map ports in the container to the host, so that we can send requests
Expand Down

0 comments on commit 02de815

Please sign in to comment.