Reputation: 791
I'm trying to containerize an application with websphere-liberty image
In my project i have a Dockerfile like this:
FROM websphere-liberty:kernel
COPY --chown=1001:0 target/demo-1.0-SNAPSHOT.war /config/dropins/verificaciones/
COPY --chown=1001:0 src/main/config/server.xml /config/
RUN configure.sh
my server.xml is this:
<server description="Sample Liberty server">
<variable name="default.http.port" defaultValue="9080"/>
<variable name="default.https.port" defaultValue="9443"/>
<webApplication location="demo-1.0-SNAPSHOT.war" contextRoot="/srp-verificaciones" />
<httpEndpoint host="*" httpPort="9080" httpsPort="-1"/>
</server>
later i run this commands:
$ docker build -t app .
$ docker run -d -p 8080:9080 app
but i get no response.
is just a servlet with a hello world.
what am i missing?
thanks for your help.
Upvotes: 0
Views: 1486
Reputation: 18030
There are several potential issues with your container:
kernel
image which doesnt include any features, so your server.xml
would need to specify features you need e.g. <!-- Enable features -->
<featureManager>
<feature>jsp-2.3</feature>
</featureManager>
COPY --chown=1001:0 target/demo-1.0-SNAPSHOT.war /config/dropins
and if you use dropins and dont have ibm-web-ext.xml
file in your WEB-INF
folder, then app is deployed on the context-root
based on your file name - in this case /demo-1.0-SNAPSHOT
In this case also you CANNOT have <webApplication ...
entry in your server.xml
<webApplication..
then your application should be put to apps
folder, NOT dropins
like this:COPY --chown=1001:0 target/demo-1.0-SNAPSHOT.war /config/apps
and in this case you can access your app by context root defined in that tag. More details here https://www.ibm.com/docs/en/was-liberty/base?topic=deploying-applications-in-liberty
So clean up your dockerfile, and if you still have issues, add full server.xml
and logs from starting the server.
Upvotes: 2