Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAVA_OPTIONS breaks jetty start #133

Open
arkanovicz opened this issue Mar 1, 2023 · 1 comment
Open

JAVA_OPTIONS breaks jetty start #133

arkanovicz opened this issue Mar 1, 2023 · 1 comment
Assignees

Comments

@arkanovicz
Copy link

Docker image: jetty:10.0.13-jdk11

If I have the following compose.yml file :

services:
  test:
    container_name: test
    image: jetty:10.0.13-jdk11
    volumes:
      - ./someapp.war:/var/lib/jetty/webapps/ROOT.war
    ports:
     - '127.0.0.1:8080:8080'

Everything works fine. But if I just try to add JAVA_OPTIONS to it, like this:

services:
  test:
    container_name: test
    image: jetty:10.0.13-jdk11
    volumes:
      - ./someapp.war:/var/lib/jetty/webapps/ROOT.war
    ports:
     - '127.0.0.1:8080:8080'
    environment:
     - JAVA_OPTIONS='-Xmx1g'

then the container exists right away with the error:

test  | Error: Could not find or load main class '-Xmx1g'
test  | Caused by: java.lang.ClassNotFoundException: '-Xmx1g'
test exited with code 1

Inside the container, when the bug happens, the file /var/lib/jetty/jetty.start is empty.

@arkanovicz
Copy link
Author

It looks like that when defining environment using a yaml map syntax rather than a yaml array syntax, everything is fine:

services:
  test:
    container_name: test
    image: jetty:10.0.13-jdk11
    volumes:
      - ./someapp.war:/var/lib/jetty/webapps/ROOT.war
    ports:
     - '127.0.0.1:8080:8080'
    environment:
      JAVA_OPTIONS: '-Xmx1g'

So that's an easy workaround. But this is a strange issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants