Comments (5)
You'll want to mount your exploded WAR directory as a subdirectory of webapps
, not at webapps
itself. If you want the app to show up at the root context (i.e. /
), then you'll need to mount it at webapps/root
. Otherwise, you'll mount it at whatever your context path is (e.g. webapps/hello-world
for /hello-world
).
from docker-jetty.
Thank you.
The exploded WAR was hello-world-0.1-SNAPSHOT. I renamed it to helloworld.
I tried:
docker run -d -p 8080:8080 -v /.../target/helloworld:/var/lb/jetty/webapps/root jetty:9
and
http://myhost:8080/
http://myhost:8080/hello/
But same-same.
from docker-jetty.
Can you make sure you're using the latest version of the jetty:9
image? It's possible you're using one from before the JETTY_BASE
changes. If so, you'd see a warning like this in docker logs
:
2015-04-18 18:48:09.240:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended. See documentation at http://www.eclipse.org/jetty/documentation/current/startup.html
2015-04-18 18:48:09.757:INFO:oejs.Server:main: jetty-9.2.9.v20150224
2015-04-18 18:48:09.826:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/usr/local/jetty/webapps/] at interval 1
I was just able to to hit a sample WAR at both /
and /sample
like this:
$ curl -fsSLO https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
$ unzip -d sample sample.war
Archive: sample.war
creating: sample/META-INF/
inflating: sample/META-INF/MANIFEST.MF
creating: sample/WEB-INF/
creating: sample/WEB-INF/classes/
creating: sample/WEB-INF/classes/mypackage/
creating: sample/WEB-INF/lib/
creating: sample/images/
inflating: sample/WEB-INF/classes/mypackage/Hello.class
inflating: sample/WEB-INF/web.xml
inflating: sample/hello.jsp
inflating: sample/images/tomcat.gif
inflating: sample/index.html
$ docker run -d -p 8080:8080 -v $(pwd)/sample:/var/lib/jetty/webapps/sample \
-v $(pwd)/sample:/var/lib/jetty/webapps/root --name jetty jetty:9
2bafba59cc22508f4eae8111e1394574d9d95d8dafd2d4eddca8e80413ee9491
This is what I see in the Docker logs after running that command:
$ docker logs jetty
Running Jetty:
2015-04-18 18:49:41.743:INFO::main: Logging initialized @431ms
2015-04-18 18:49:42.006:INFO:oejs.SetUIDListener:main: Setting umask=02
2015-04-18 18:49:42.020:INFO:oejs.SetUIDListener:main: Opened ServerConnector@6387a6dd{HTTP/1.1}{0.0.0.0:8080}
2015-04-18 18:49:42.020:INFO:oejs.SetUIDListener:main: Setting GID=999
2015-04-18 18:49:42.021:INFO:oejs.SetUIDListener:main: Setting UID=999
2015-04-18 18:49:42.027:INFO:oejs.Server:main: jetty-9.2.10.v20150310
2015-04-18 18:49:42.045:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/var/lib/jetty/webapps/] at interval 1
2015-04-18 18:49:42.603:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@55716fcd{/sample,file:/var/lib/jetty/webapps/sample/,AVAILABLE}{/sample}
2015-04-18 18:49:42.817:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@44eeef95{/,file:/var/lib/jetty/webapps/root/,AVAILABLE}{/root}
2015-04-18 18:49:42.834:INFO:oejs.ServerConnector:main: Started ServerConnector@6387a6dd{HTTP/1.1}{0.0.0.0:8080}
2015-04-18 18:49:42.835:INFO:oejs.Server:main: Started @1523ms
Notice in particular the Deployment monitor [file:/var/lib/jetty/webapps/]
part.
from docker-jetty.
I really appreciate your help with this.
This works perfectly for me. I'm going to review and see what I'm doing wrong with my helloworld app.
Thank you.
from docker-jetty.
👍
If you end up finding anything wrong with the jetty
image, feel free to reopen this issue.
from docker-jetty.
Related Issues (20)
- Issues with Docker Build with 1.8.0_191 HOT 2
- Provide Jetty images based on openjdk:11-jre-slim HOT 7
- jetty:9-jre8 SSL no longer works, FIN sent in reply to CLIENT_HELLO HOT 7
- jetty user home is not properly set HOT 5
- sqlite (used in sqlite-libs) version 3.26.0-r3 has 2 vulnerabilities HOT 1
- Mail library included in jetty-jre11 is not compatible with JDK11 HOT 11
- Docker image for jetty 10 HOT 3
- TMPDIR /tmp/jetty not used
- Replace sks-keyservers.net HOT 9
- Discontinue building the image based on OpenJDK JRE 7 HOT 1
- Old version 9.4.18 in docker hub HOT 1
- Container exits immediately when using JDWP in JAVA_OPTIONS HOT 4
- Jetty on top of Openjdk-8 JDK version HOT 2
- Add jetty 9 images based on AdoptOpenJDK HOT 1
- Stop supporting deprecated versions of Jetty HOT 5
- Move official docker-jetty project to the jetty project HOT 3
- jetty 9.4.29 released HOT 1
- Empty jetty.start file HOT 5
- start.jar explodes: missing/invalid file modules/alpn-impl/alpn-1.8.0_181.mod HOT 4
- Any plans for jre11 ? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-jetty.