File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed
dotted-environment-variables Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ public class container {
2+ /**
3+ * Check if dotted env vars are supported.
4+ */
5+ public static void main (String [] args ) {
6+ // get value of variable.with.a.dot and print it out
7+ String value = System .getenv ("variable.with.a.dot" );
8+ System .out .println (value );
9+ System .exit (0 );
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ a.dotted.value
Original file line number Diff line number Diff line change 1+ ../run-java-in-container.sh
Original file line number Diff line number Diff line change @@ -51,4 +51,9 @@ COPY --from=jdk /container /container
5151WORKDIR /container
5252EOD
5353
54- docker run --rm " $newImage " java -cp . container
54+ # if testDir contains dotted-environment-variables we need to add an environment variable to the docker run command
55+ if [ $testDir == * " dotted-environment-variables" * ]; then
56+ docker run --rm -e " variable.with.a.dot=a.dotted.value" " $newImage " java -cp . container
57+ else
58+ docker run --rm " $newImage " java -cp . container
59+ fi
You can’t perform that action at this time.
0 commit comments