Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ COPY --chown=1001:0 server.xml /config/
# A sample is in the 'Getting Required Features' section below
COPY --chown=1001:0 featureUtility.properties /opt/ol/wlp/etc/

# This script will add the requested XML snippets to enable Liberty features and grow image to be fit-for-purpose using featureUtility.
# Only available in 'kernel-slim'. The 'full' tag already includes all features for convenience.
RUN features.sh

# Add interim fixes (optional)
COPY --chown=1001:0 interim-fixes /opt/ol/fixes/

# This script will add the requested XML snippets to enable Liberty features, grow image to be fit-for-purpose using featureUtility and apply any interim fixes.
# Only available in 'kernel-slim'. The 'full' tag already includes all features for convenience.
RUN features.sh

# Add app
COPY --chown=1001:0 Sample1.war /config/dropins/

# This script will add the requested server configurations, apply any interim fixes and populate caches to optimize runtime
# This script will add the requested server configurations and populate caches to optimize runtime
RUN configure.sh
```

Expand Down
5 changes: 2 additions & 3 deletions releases/latest/beta/helpers/build/configure.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

function main() {
##Define variables for XML snippets source and target paths
WLP_INSTALL_DIR=/opt/ol/wlp
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources

Expand Down Expand Up @@ -93,7 +92,7 @@ function main() {
# Apply interim fixes found in /opt/ol/fixes
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ol/fixes
# Note: This step should be done once needed features are enabled and installed.
find /opt/ol/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
installFixes

# Force the server.xml to be processed by updating its timestamp
touch /config/server.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down
2 changes: 1 addition & 1 deletion releases/latest/beta/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down
5 changes: 2 additions & 3 deletions releases/latest/full/helpers/build/configure.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

function main() {
##Define variables for XML snippets source and target paths
WLP_INSTALL_DIR=/opt/ol/wlp
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources

Expand Down Expand Up @@ -93,7 +92,7 @@ function main() {
# Apply interim fixes found in /opt/ol/fixes
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ol/fixes
# Note: This step should be done once needed features are enabled and installed.
find /opt/ol/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
installFixes

# Force the server.xml to be processed by updating its timestamp
touch /config/server.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down
2 changes: 1 addition & 1 deletion releases/latest/full/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down
7 changes: 4 additions & 3 deletions releases/latest/kernel-slim/helpers/build/configure.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash

. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

function main() {
##Define variables for XML snippets source and target paths
WLP_INSTALL_DIR=/opt/ol/wlp
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources

Expand Down Expand Up @@ -52,7 +51,7 @@ function main() {
# Apply interim fixes found in /opt/ol/fixes
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ol/fixes
# Note: This step should only be done ONCE needed features are enabled and installed.
find /opt/ol/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
installFixes

# Force the server.xml to be processed by updating its timestamp
touch /config/server.xml
Expand Down Expand Up @@ -80,6 +79,8 @@ function main() {
fi
eval $cmd
fi

removeBuildArtifacts
}

## parse provider list to generate files into configDropins
Expand Down
7 changes: 6 additions & 1 deletion releases/latest/kernel-slim/helpers/build/features.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down Expand Up @@ -31,3 +31,8 @@ fi
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
find /opt/ol/wlp/lib /opt/ol/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw

# Apply interim fixes found in /opt/ol/fixes
# Fixes recommended by IBM, such as to resolve security vulnerabilities, are also included in /opt/ol/fixes
# Note: This step should only be done ONCE needed features are enabled and installed.
installFixes

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down
17 changes: 0 additions & 17 deletions releases/latest/kernel-slim/helpers/build/internal/logger.sh

This file was deleted.

30 changes: 30 additions & 0 deletions releases/latest/kernel-slim/helpers/build/internal/utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

function main() {
WLP_TYPE=ol
WLP_INSTALL_DIR=/opt/$WLP_TYPE/wlp
if [ "$VERBOSE" != "true" ]; then
exec >/dev/null
fi
}

function hideLogs() {
exec 3>&1 >/dev/null 4>&2 2>/dev/null
}

function showLogs() {
exec 1>&3 3>&- 2>&4 4>&-
}

function installFixes() {
if [ ! -f "/logs/fixes.log" ] && ls "/opt/$WLP_TYPE/fixes"/*.jar 1> /dev/null 2>&1; then
find /opt/$WLP_TYPE/fixes -type f -name "*.jar" -print0 | sort -z | xargs -0 -n 1 -r -I {} java -jar {} --installLocation $WLP_INSTALL_DIR
echo "installFixes has been run successfully" > /logs/fixes.log
fi
}

function removeBuildArtifacts() {
rm -f /logs/fixes.log
}

main
2 changes: 1 addition & 1 deletion releases/latest/kernel-slim/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
. /opt/ol/helpers/build/internal/logger.sh
. /opt/ol/helpers/build/internal/utils.sh

set -Eeox pipefail

Expand Down