Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change server to runtime or instance #44

Merged
merged 4 commits into from
Aug 16, 2023
Merged
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
19 changes: 9 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ endif::[]

// static guide instructions:
ifndef::cloud-hosted[]
After you are finished checking out the microservices, stop the Open Liberty servers by pressing `CTRL+C`
in the command-line sessions where you ran the servers. Alternatively, you can run the `liberty:stop` goal in another command-line session:
After you are finished checking out the microservices, stop the Open Liberty instances by pressing `CTRL+C`
in the command-line sessions where you ran the `system` and `inventory` services. Alternatively, you can run the `liberty:stop` goal in another command-line session:
[role='command']
```
mvn -pl system liberty:stop
Expand All @@ -161,9 +161,8 @@ endif::[]

// cloud-hosted guide instructions:
ifdef::cloud-hosted[]
After you are finished checking out the microservices, stop the Open Liberty servers by pressing **CTRL+C**
in the command-line sessions where you ran the servers. Alternatively, you can run the **liberty:stop** goal in another command-line session from the
**start** directory:
After you are finished checking out the microservices, stop the Open Liberty instances by pressing **CTRL+C**
in the command-line sessions where you ran the **system** and **inventory** services. Alternatively, you can run the **liberty:stop** goal in another command-line session from the **start** directory:
```
cd /home/project/guide-containerize/start
mvn -pl system liberty:stop
Expand Down Expand Up @@ -226,7 +225,7 @@ Furthermore, you can label your container images with the [hotspot=label file=0]

The [hotspot=copy-config hotspot=copy-war file=0]`COPY` instructions are structured as `COPY` [hotspot=config-userID hotspot=war-userID file=0]`[--chown=<user>:<group>]` [hotspot=inventory-config hotspot=inventory-war file=0]`<source>` [hotspot=config hotspot=config-apps file=0]`<destination>`.
They copy local files into the specified destination within your container image.
In this case, the `inventory` server configuration files that are located at `src/main/liberty/config` are copied to the [hotspot=config file=0]`/config/` destination directory.
In this case, the `inventory` Liberty configuration files that are located at `src/main/liberty/config` are copied to the [hotspot=config file=0]`/config/` destination directory.
The `inventory` application WAR file [hotspot=inventory-war file=0]`inventory.war`, which was created from running `mvn package`, is copied to the [hotspot=config-apps file=0]`/config/apps` destination directory.

The [hotspot=copy-config hotspot=copy-war file=0]`COPY` instructions use the [hotspot=config-userID hotspot=war-userID file=0]`1001` user ID and [hotspot=config-userID hotspot=war-userID file=0]`0` group because all official Open Liberty base images,
Expand Down Expand Up @@ -398,7 +397,7 @@ curl -s http://localhost:9081/inventory/systems | jq
{: codeblock}
endif::[]

== Externalizing server configuration
== Externalizing Liberty's configuration

// File 0
inventory/server.xml
Expand All @@ -410,7 +409,7 @@ include::finish/inventory/src/main/liberty/config/server.xml[]
As mentioned at the beginning of this guide, one of the advantages of using
containers is that they are portable and can be moved and deployed efficiently
across all of your DevOps environments. Configuration often changes across
different environments, and by externalizing your server configuration, you
different environments, and by externalizing your Liberty's configuration, you
can simplify the development process.

Imagine a scenario where you are developing an Open Liberty application on
Expand Down Expand Up @@ -491,12 +490,12 @@ curl -s http://localhost:9080/system/properties | jq
endif::[]

You can externalize the configuration of more than just the port numbers.
To learn more about Open Liberty server configuration, check out the
To learn more about Open Liberty configuration, check out the
https://openliberty.io/docs/latest/reference/config/server-configuration-overview.html[Server Configuration Overview^] docs.

== Optimizing the image size

As mentioned previously, the parent image that is used in each `Containerfile` contains the `full` tag, which includes all of the Liberty features. This parent image with the `full` tag is recommended for development, but while deploying to production it is recommended to use a parent image with the `kernel-slim` tag. The `kernel-slim` tag provides a bare minimum server with the ability to add the features required by the application.
As mentioned previously, the parent image that is used in each `Containerfile` contains the `full` tag, which includes all of the Liberty features. This parent image with the `full` tag is recommended for development, but while deploying to production it is recommended to use a parent image with the `kernel-slim` tag. The `kernel-slim` tag provides a bare minimum Liberty runtime with the ability to add the features required by the application.

[role="code_command hotspot file=0", subs="quotes"]
----
Expand Down