2

Team, Is it possible to use springBootUtility with OpenLiberty kernel-slim UBI images (e.g. - kernel-slim-java8-openj9-ubi) ? https://openliberty.io/docs/21.0.0.7/reference/command/springbootUtility-thin.html

Because, it's giving an error as

Step 3/11 : RUN springBootUtility thin --sourceAppPath=/staging/fat-order-0.0.1-SNAPSHOT.jar --targetThinAppPath=/staging/thin-order-0.0.1-SNAPSHOT.jar --targetLibCachePath=/staging/lib.index.cache ---> Running in 3023c669c4d7 /bin/sh: springBootUtility: command not found

The springBootUtility is only working with OpenLiberty full UBI images

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
Maddy
  • 21
  • 2
  • It looks like you should specify the complete path to `springBootUtility`, or add the localization in it. `export PATH=$PATH:path_to_liberty/wlp/bin/` or something. – J. Chomel Jul 28 '21 at 14:24
  • Thanks Chomel. I already tried with this and getting same error. Do you have any example that showing for kernel-slim ubi images because its working find fine and built using full docker image – Maddy Jul 28 '21 at 14:32
  • the path might not be correctly defined in the thread. I do not know how. btw you should describe what you tried already to help the community. – J. Chomel Jul 28 '21 at 14:35

1 Answers1

2

The kernel-slim image does not appear to have that command at all. Compare kernel-slim:

bash-5.1$ docker run --rm -it openliberty/open-liberty:kernel-slim-java8-openj9-ubi ls /opt/ol/wlp/bin
auditUtility      binaryLog.bat       productInfo      securityUtility.bat  serverSchemaGen
auditUtility.bat  featureUtility      productInfo.bat  server           serverSchemaGen.bat
binaryLog     featureUtility.bat  securityUtility  server.bat       tools

To full:

bash-5.1$ docker run --rm -it openliberty/open-liberty:full-java8-openj9-ubi ls /opt/ol/wlp/bin
auditUtility      binaryLog.bat  featureUtility      pluginUtility  securityUtility.bat  springBootUtility
auditUtility.bat  client     featureUtility.bat  pluginUtility.bat  server           springBootUtility.bat
batchManager      client.bat     jaxb            productInfo    server.bat       tools
batchManager.bat  ddlGen     jaxrs           productInfo.bat    serverSchemaGen
binaryLog     ddlGen.bat     jaxws           securityUtility    serverSchemaGen.bat

There appears to be a hole in the documentation, since nothing indicates you need to do this, but you need to install the springBoot feature into Open Liberty before the command will be added. Copy your server.xml with spring boot specified into the image, then run features.sh:

COPY --chown=1001:0 server.xml /config/
RUN features.sh

After that, springBootUtility will be placed in the /opt/ol/wlp/bin dir and should be on the path as well for further Dockerfile directives to use.

lwestby
  • 1,209
  • 6
  • 10
  • And here's a sample of this: https://github.com/OpenLiberty/ci.docker/blob/master/samples/spring-petclinic/ – Scott Kurz Jul 28 '21 at 14:58