Skip to content

Commit c55442d

Browse files
authored
Merge pull request #251 from OpenLiberty/staging
Merge staging to prod - Explain features.sh and configure.sh in Dockerfile (#242)
2 parents e21897c + 0a28a84 commit c55442d

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

README.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@ Dockerfile
113113
include::finish/Dockerfile[]
114114
----
115115

116-
The [hotspot=from file=0]`FROM` instruction initializes a new build stage and indicates the parent image from which your image is built. If you don't need a parent image, then use `FROM scratch`, which makes your image a base image.
116+
The [hotspot=from file=0]`FROM` instruction initializes a new build stage and indicates the parent image from which your image is built. If you don't need a parent image, then use `FROM scratch`, which makes your image a base image. In this case, you’re using the `icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi` image as your parent image, which comes with the latest Open Liberty runtime.
117117

118-
In this case, you’re using the `icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi` image as your parent image, which comes with the latest Open Liberty runtime.
118+
The [hotspot=copy1 hotspot=copy2 file=0]`COPY` instructions are structured as `COPY` `[--chown=<user>:<group>]` `<source>` `<destination>`. They copy local files into the specified destination within your Docker image. In this case, the Liberty configuration file that is located at `src/main/liberty/config/server.xml` is copied to the `/config/` destination directory.
119119

120-
The [hotspot=copy file=0]`COPY` instructions are structured as `COPY` `[--chown=<user>:<group>]` `<source>` `<destination>`. They copy local files into the specified destination within your Docker image. In this case, the Liberty configuration file that is located at `src/main/liberty/config/server.xml` is copied to the `/config/` destination directory.
120+
The [hotspot=features hotspot=configure file=0]`RUN` instructions execute commands in a new layer on top of the current image and commit the results. In this case, they run the [hotspot=features file=0]`features.sh` and [hotspot=configure file=0]`configure.sh` scripts to install the required features and finalize the server configuration for your Open Liberty application.
121+
122+
The [hotspot=features file=0]`features.sh` script adds the requested XML snippets to enable Liberty features by using https://openliberty.io/docs/latest/reference/command/featureUtility-commands.html[featureUtility^]. Because you're starting with the [hotspot=from file=0]`kernel-slim` image, which provides only the bare minimum server, the script reads your `server.xml` file to identify the required features and installs them into your Docker image.
123+
124+
The [hotspot=configure file=0]`configure.sh` script adds the requested server configurations, applies any interim fixes, and populates caches to optimize the runtime.
121125

122126
=== Writing a .dockerignore file
123127

finish/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ LABEL \
2727
USER root
2828
# end::user-root[]
2929

30-
# tag::copy[]
30+
# tag::copy1[]
3131
COPY --chown=1001:0 src/main/liberty/config/server.xml /config/
32+
# end::copy1[]
33+
# tag::features[]
3234
RUN features.sh
35+
# end::features[]
36+
# tag::copy2[]
3337
COPY --chown=1001:0 target/*.war /config/apps/
34-
# end::copy[]
38+
# end::copy2[]
39+
# tag::configure[]
3540
RUN configure.sh
41+
# end::configure[]
3642
# tag::user[]
3743
USER 1001
3844
# end::user[]

0 commit comments

Comments
 (0)