0

I have created my own Docker image using following Dockerfile:-

FROM open-liberty:webProfile8
COPY mysample.war /config/dropins/
COPY server.xml /config/

Docker image got generated with some warning:-

Successfully built cc05c3d94adf Successfully tagged sampleopenlibty:latest SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

I pushed this image to Azure Container Repository and created an App Service out of it but whenever I browse to the Web-App instead of showing my custom/sample web app it shows the out of the box PAGE of Open Liberty.

Can someone please help me what I would have done wrong to fix this issue?

Thank you

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
user42012
  • 722
  • 12
  • 33
  • Are you sure you tested the right context root for your deployed application? Can you show your dockerfile and server logs? – covener Apr 26 '19 at 13:16
  • You also may find it more straightforward to debug by `docker run` the image locally, before you push it out to a cloud service. – David Maze Apr 26 '19 at 13:48
  • 2019-04-26 12:36:35.655 INFO - Container abcdlibertytestv1_0 for site abcdlibertytestv1 initialized successfully and is ready to serve requests. – user42012 Apr 26 '19 at 14:43
  • 1
    please update your original question with this info instead of adding it all in comments – Andy Guibert Apr 26 '19 at 14:58
  • I have run the image Locally and it doesnt render anything :( when I go to localhost:9080. I have used following command to run it: $ docker run -d -p 88:9080 -p 443:9443 -v /tmp/DefaultServletEngine/dropins/abcConnector-Liberty.war:/config/dropins/abcConnector-Liberty.war open-liberty:webProfile8 – user42012 Apr 26 '19 at 15:12
  • @covener .. can you please help me with what should be the context root? I have it as . I am deploying this to an Azure website with url "abcdefg.azurewebsites.net" and I think somewhere the contextRoot mentioned in the file is wrong. I am novice (2 days into this) so not sure what shld be mentioned. The WAR file and server.xml was given by Dev Team to deploy in Azure. any help? – user42012 Apr 26 '19 at 16:01
  • if you are trying to go to localhost:9080, you should use `-p 9080:9080` instead of `-p 88:9080` on your docker command. Since you are getting started with Liberty, perhaps the Liberty Docker guide would answer some of your questions: https://openliberty.io/guides/docker.html – Andy Guibert Apr 26 '19 at 16:45
  • thnx Andy. But I need to get this application deployed to Azure and unfortunately my role is limited to Azure and I am just struggling to get this SERVER.xml correct. As the team has given me a WAR file , a Server.xml file and I have to generate the docker image from it and deploy to Open Liberty and then to ACR in azure. hence want to know what is wrong in the server.xml that even after deploying to Azure its simply showing the out of the box openliberty page – user42012 Apr 26 '19 at 17:09
  • ok Solved the issue, it was pertaining to the DATABASE connectivity we have in our sample WAR file. we defined some Application settings (Env. vriables) but somehow they are not getting picked up by the app hosted in Docker image. After hard coding it in the code and deployng it everything works. So now it boils down to fixing the Application settings (Env. varible) to get it all working. – user42012 Apr 26 '19 at 18:50
  • I summarize and post a reply. You could mark it to close the issue. – Joey Cai Apr 29 '19 at 02:26

2 Answers2

0

I just summarize your comment and post it as an answer.

It was related to the Database connectivity which is in the sample WAR file. We defined some Application settings (Env. vriables) but somehow they are not getting picked up by the app hosted in Docker image. After hard coding it in the code and deployng it everything works.

So now it boils down to fixing the Application settings (Env. varible) to get it all working.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
0

use COPY --chown=1001:0 mysample.war /config/dropins/

to know more open-liberty-docker-docs read Updating file permissions