I am running jetty from a docker-composer.yml file. I had changed the port mapping like this:
services:
web:
image: jetty
ports:
- "8000:8000"
This does not change the port that jetty starts up on. How do I go about doing this from a dockerized jetty?
By default jetty runs on port 8080
. So you compose file should be
services:
web:
image: jetty
ports:
- "8000:8080"
This maps port 8080
from inside the container to port 8000
on your host. Though you should not need to run jetty on port 80 inside the container. But if you still need to for some reason then you need to use the jetty config options using JAVA_OPTIONS
services:
web:
image: jetty
environment:
JAVA_OPTIONS: "-Djetty.port=80"
ports:
- "8000:80"
So port 80
inside the container and port 8000
on your host machine.