dockerfile to deploy to tomcat server does not display webappDifference between the Apache HTTP Server and Apache Tomcat?Docker maven and jenkins, mvn install failed requesting junit:junit:jar:3.xJenkins build + Docker + auto deploymentHow to deploy jar/war to nexus in the docker build?Deploying Java application in tomcat docker containerDeploy .war on tomcat Docker containerHow can I use Jar produced by mvn package in another Jenkins declarative pipeline stage?Jenkins Pipeline - Cannot connect to the Docker daemonIn docker contaier warfile folder is not created in webapps after start the tomcatInstalling NPM and Maven packages in a dockerfile

Mathematica command that allows it to read my intentions

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

ssTTsSTtRrriinInnnnNNNIiinngg

How much of data wrangling is a data scientist's job?

Forgetting the musical notes while performing in concert

Why didn't Boeing produce its own regional jet?

Why can't we play rap on piano?

What about the virus in 12 Monkeys?

Solving a recurrence relation (poker chips)

How to prevent "they're falling in love" trope

How do I handle a potential work/personal life conflict as the manager of one of my friends?

Should I tell management that I intend to leave due to bad software development practices?

Why didn't Miles's spider sense work before?

What does the expression "A Mann!" means

Avoiding direct proof while writing proof by induction

Assassin's bullet with mercury

How to tell a function to use the default argument values?

Im going to France and my passport expires June 19th

Alternative to sending password over mail?

How can I determine if the org that I'm currently connected to is a scratch org?

Is it logically or scientifically possible to artificially send energy to the body?

What do you call someone who asks many questions?

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?



dockerfile to deploy to tomcat server does not display webapp


Difference between the Apache HTTP Server and Apache Tomcat?Docker maven and jenkins, mvn install failed requesting junit:junit:jar:3.xJenkins build + Docker + auto deploymentHow to deploy jar/war to nexus in the docker build?Deploying Java application in tomcat docker containerDeploy .war on tomcat Docker containerHow can I use Jar produced by mvn package in another Jenkins declarative pipeline stage?Jenkins Pipeline - Cannot connect to the Docker daemonIn docker contaier warfile folder is not created in webapps after start the tomcatInstalling NPM and Maven packages in a dockerfile













0















I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. the mvn clean package command works well in the jenkins job, and the subsequent dockerfile spawns an image where the webapp.war file will be placed in tomcat home directory.(/usr/local/tomcat/webapp/webapp.war)
This is supposed to display o/p on the tomcat page running over port 8181, but i cannot get it to work.The tomcat is working though



The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI



This is the output instead of the hello world










share|improve this question






















  • This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

    – Andreas Lorenzen
    Mar 8 at 22:53











  • I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

    – kush shah
    Mar 8 at 23:46
















0















I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. the mvn clean package command works well in the jenkins job, and the subsequent dockerfile spawns an image where the webapp.war file will be placed in tomcat home directory.(/usr/local/tomcat/webapp/webapp.war)
This is supposed to display o/p on the tomcat page running over port 8181, but i cannot get it to work.The tomcat is working though



The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI



This is the output instead of the hello world










share|improve this question






















  • This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

    – Andreas Lorenzen
    Mar 8 at 22:53











  • I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

    – kush shah
    Mar 8 at 23:46














0












0








0








I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. the mvn clean package command works well in the jenkins job, and the subsequent dockerfile spawns an image where the webapp.war file will be placed in tomcat home directory.(/usr/local/tomcat/webapp/webapp.war)
This is supposed to display o/p on the tomcat page running over port 8181, but i cannot get it to work.The tomcat is working though



The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI



This is the output instead of the hello world










share|improve this question














I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. the mvn clean package command works well in the jenkins job, and the subsequent dockerfile spawns an image where the webapp.war file will be placed in tomcat home directory.(/usr/local/tomcat/webapp/webapp.war)
This is supposed to display o/p on the tomcat page running over port 8181, but i cannot get it to work.The tomcat is working though



The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI



This is the output instead of the hello world







maven docker tomcat jenkins






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 22:40









kush shahkush shah

125




125












  • This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

    – Andreas Lorenzen
    Mar 8 at 22:53











  • I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

    – kush shah
    Mar 8 at 23:46


















  • This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

    – Andreas Lorenzen
    Mar 8 at 22:53











  • I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

    – kush shah
    Mar 8 at 23:46

















This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

– Andreas Lorenzen
Mar 8 at 22:53





This will build your image - but how do you start the container then? Are you doing that manually afterwards? I am concerned that you are looking at a previously deployed tomcat container without your application deployed.

– Andreas Lorenzen
Mar 8 at 22:53













I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

– kush shah
Mar 8 at 23:46






I go to the terminal, check for the images i have, and run the latest version. Then localhost to the port. It will be the latest version cz the Dockerfile indexes the versions concurrent to the jenkins build number. so if i just built my project on build #10, my tomcat image will have version 10 with it.

– kush shah
Mar 8 at 23:46













1 Answer
1






active

oldest

votes


















0














You have an error in your Dockerfile.



The directory is called /usr/local/tomcat/webapps/, so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/



Update the Dockerfile to this:



FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]


Now visit the site http://localhost:8181/webapp






share|improve this answer

























  • I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

    – kush shah
    Mar 9 at 0:06











  • That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

    – Andreas Lorenzen
    Mar 9 at 0:15











  • I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

    – kush shah
    Mar 9 at 0:19











  • The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

    – Andreas Lorenzen
    Mar 9 at 0:21












  • Understood, Thank you.

    – kush shah
    Mar 9 at 2:10











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071996%2fdockerfile-to-deploy-to-tomcat-server-does-not-display-webapp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You have an error in your Dockerfile.



The directory is called /usr/local/tomcat/webapps/, so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/



Update the Dockerfile to this:



FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]


Now visit the site http://localhost:8181/webapp






share|improve this answer

























  • I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

    – kush shah
    Mar 9 at 0:06











  • That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

    – Andreas Lorenzen
    Mar 9 at 0:15











  • I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

    – kush shah
    Mar 9 at 0:19











  • The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

    – Andreas Lorenzen
    Mar 9 at 0:21












  • Understood, Thank you.

    – kush shah
    Mar 9 at 2:10















0














You have an error in your Dockerfile.



The directory is called /usr/local/tomcat/webapps/, so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/



Update the Dockerfile to this:



FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]


Now visit the site http://localhost:8181/webapp






share|improve this answer

























  • I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

    – kush shah
    Mar 9 at 0:06











  • That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

    – Andreas Lorenzen
    Mar 9 at 0:15











  • I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

    – kush shah
    Mar 9 at 0:19











  • The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

    – Andreas Lorenzen
    Mar 9 at 0:21












  • Understood, Thank you.

    – kush shah
    Mar 9 at 2:10













0












0








0







You have an error in your Dockerfile.



The directory is called /usr/local/tomcat/webapps/, so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/



Update the Dockerfile to this:



FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]


Now visit the site http://localhost:8181/webapp






share|improve this answer















You have an error in your Dockerfile.



The directory is called /usr/local/tomcat/webapps/, so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/



Update the Dockerfile to this:



FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]


Now visit the site http://localhost:8181/webapp







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 9 at 0:18

























answered Mar 8 at 23:58









Andreas LorenzenAndreas Lorenzen

1,058412




1,058412












  • I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

    – kush shah
    Mar 9 at 0:06











  • That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

    – Andreas Lorenzen
    Mar 9 at 0:15











  • I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

    – kush shah
    Mar 9 at 0:19











  • The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

    – Andreas Lorenzen
    Mar 9 at 0:21












  • Understood, Thank you.

    – kush shah
    Mar 9 at 2:10

















  • I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

    – kush shah
    Mar 9 at 0:06











  • That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

    – Andreas Lorenzen
    Mar 9 at 0:15











  • I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

    – kush shah
    Mar 9 at 0:19











  • The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

    – Andreas Lorenzen
    Mar 9 at 0:21












  • Understood, Thank you.

    – kush shah
    Mar 9 at 2:10
















I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

– kush shah
Mar 9 at 0:06





I entered the container with bash, and i checked that the webapp.war file is stored in the 'webapp' directory. Agreed there is another 'webapps' dir but thats not where the war file is stored.

– kush shah
Mar 9 at 0:06













That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

– Andreas Lorenzen
Mar 9 at 0:15





That is because you copied it there in your Dockerfile. You need to copy it to the webapps directory in order for tomcat to mount it. The webapp directory was created when you copied the file there. Try the code that I pasted above.

– Andreas Lorenzen
Mar 9 at 0:15













I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

– kush shah
Mar 9 at 0:19





I actually tried that, and it worked (Thank You!). I still cannot understand though, if all files under /usr/local/tomcat/ are visible, then why can't I just put this in any folder of my choice and try to run it on tomcat?

– kush shah
Mar 9 at 0:19













The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

– Andreas Lorenzen
Mar 9 at 0:21






The .war package is mounted by tomcat as a java web application - it only does this out of the webapps location. Other static content can be served from the web root I guess. Can you accept the answer then?

– Andreas Lorenzen
Mar 9 at 0:21














Understood, Thank you.

– kush shah
Mar 9 at 2:10





Understood, Thank you.

– kush shah
Mar 9 at 2:10



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071996%2fdockerfile-to-deploy-to-tomcat-server-does-not-display-webapp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme