Skip to content

Commit acea753

Browse files
Update README.md
1 parent 9258942 commit acea753

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

java-8/README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ Make your app expose services on port 8080 as default.
1414

1515
Include custom Java options in `$JAVA_OPTS`.
1616

17+
By default, the base image will copy all JAR files in the `target/` directory. If there's exactly one JAR file present,
18+
there's no need calling it `app.jar` or specifying the `JAR_FILE` env: the run script will use it as is.
19+
20+
If, however, there are one or more JAR files present, one must either call the main JAR `app.jar` or specify `JAR_FILE`.
21+
1722
Example
1823
---------------------
1924

2025
The `Dockerfile` below allows us to specify an alternate JAR file build time (via `--build-arg JAR_FILE=my.jar`)
2126
and run time as an environment variable. We also specify additional options for the JVM:
2227

2328
```
24-
FROM nais:java-8
29+
FROM navikt/java:8
2530
2631
ARG JAR_FILE
2732
ENV JAR_FILE ${JAR_FILE}
@@ -43,4 +48,4 @@ to the default `myapp-BUILD_NO`, where `BUILD_NO` is specified build time:
4348

4449
```
4550
docker build -t myapp:latest --build-arg BUILD_NO=1337 .
46-
```
51+
```

0 commit comments

Comments
 (0)