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
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
add a comment |
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
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
add a comment |
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
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
maven docker tomcat jenkins
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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 thewebapps
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 thewebapps
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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 thewebapps
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 thewebapps
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
add a comment |
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
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 thewebapps
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 thewebapps
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
add a comment |
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
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
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 thewebapps
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 thewebapps
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
add a comment |
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 thewebapps
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 thewebapps
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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