Skip to content

Commit 22e8b0c

Browse files
committed
app.jar: Include OS information
Prints os.name, os.version and os.arch on startup.
1 parent f3a0862 commit 22e8b0c

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ The base image contains a simple `app.jar` to demonstrate the default entrypoint
1212
Running the image without any arguments:
1313

1414
```
15-
> docker run ghcr.io/formcentric/java-base:11-jre
15+
> docker run ghcr.io/formcentric/java-base:21-jre
1616
1717
Welcome to the Formcentric Java Base image.
1818
19-
Java Version : 11.0.18 (Eclipse Adoptium)
19+
Java Version : 21.0.6 (Eclipse Adoptium)
2020
Java Home : /opt/java/openjdk
2121
Java Temp Dir : /tmp
2222
2323
User Name : formcentric
2424
Working Dir : /formcentric
25+
OS : Linux 6.11.0-18-generic
26+
Architecture : amd64
2527
2628
JVM Arguments
27-
- none -
29+
(1) -XX:-UsePerfData
30+
(2) -XX:+UseContainerSupport
31+
(3) -Djava.security.egd=file:/dev/./urandom
2832
2933
Command Line Arguments
3034
- none -
@@ -33,19 +37,24 @@ Command Line Arguments
3337
Passing JVM and command line arguments:
3438

3539
```
36-
> docker run -e JAVA_OPTS=-Djava.io.tmpdir=/my-tmp ghcr.io/formcentric/java-base:11-jre --server.port=8443
40+
> docker run -e JAVA_OPTS=-Djava.io.tmpdir=/my-tmp ghcr.io/formcentric/java-base:21-jre --server.port=8443
3741
3842
Welcome to the Formcentric Java Base image.
3943
40-
Java Version : 11.0.18 (Eclipse Adoptium)
44+
Java Version : 21.0.6 (Eclipse Adoptium)
4145
Java Home : /opt/java/openjdk
4246
Java Temp Dir : /my-tmp
4347
4448
User Name : formcentric
4549
Working Dir : /formcentric
50+
OS : Linux 6.11.0-18-generic
51+
Architecture : amd64
4652
4753
JVM Arguments
48-
(1) -Djava.io.tmpdir=/my-tmp
54+
(1) -XX:-UsePerfData
55+
(2) -Djava.io.tmpdir=/my-tmp
56+
(3) -XX:+UseContainerSupport
57+
(4) -Djava.security.egd=file:/dev/./urandom
4958
5059
Command Line Arguments
5160
(1) --server.port=8443

app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<plugin>
2222
<groupId>org.apache.maven.plugins</groupId>
2323
<artifactId>maven-jar-plugin</artifactId>
24-
<version>3.3.0</version>
24+
<version>3.4.2</version>
2525
<configuration>
2626
<archive>
2727
<manifest>

app/src/main/java/com/formcentric/Main.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public static void main(String[] args) {
1616
System.out.println();
1717
System.out.println(" User Name : " + System.getProperty("user.name"));
1818
System.out.println(" Working Dir : " + System.getProperty("user.dir"));
19+
System.out.println(" OS : " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
20+
System.out.println(" Architecture : " + System.getProperty("os.arch"));
1921
System.out.println();
2022

2123
// JVM arguments

app/target/app.jar

108 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)