Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/tests/dotted-environment-variables/container.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class container {
/**
* Check if dotted env vars are supported.
*/
public static void main(String[] args) {
// get value of variable.with.a.dot and print it out
String value = System.getenv("variable.with.a.dot");
System.out.println(value);
System.exit(0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a.dotted.value
1 change: 1 addition & 0 deletions test/tests/dotted-environment-variables/run.sh
7 changes: 6 additions & 1 deletion test/tests/run-java-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ COPY --from=jdk /container /container
WORKDIR /container
EOD

docker run --rm "$newImage" java -cp . container
# if testDir contains dotted-environment-variables we need to add an environment variable to the docker run command
if [[ "$testDir" == *"dotted-environment-variables"* ]]; then
docker run --rm -e "variable.with.a.dot=a.dotted.value" "$newImage" java -cp . container
else
docker run --rm "$newImage" java -cp . container
fi