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

jib:dockerBuild using Jetty 9.4.4, which doesn't support Java 9 #1239

Closed
guilleojeda opened this issue Nov 11, 2018 · 5 comments
Closed

jib:dockerBuild using Jetty 9.4.4, which doesn't support Java 9 #1239

guilleojeda opened this issue Nov 11, 2018 · 5 comments

Comments

@guilleojeda
Copy link

Description of the issue:
After building my application with mvn package jib:dockerBuild (which is successful) and deploying it with docker-compose up, the Jetty container for my application is using jetty-9.4.4.v20170414 and I get some jar parsing errors that (according to this StackOverflow answer) happen because support for Java 9 was introduced in Jetty 9.4.9

Perhaps there is a way to configure the Jetty version and this is not a bug. I haven't found any.
Perhaps the latest tag from the container registry jib is pulling the base image from is outdated (though it was dated on October 20th). In such case, it might be worth considering using a different registry, or looking into a way to build the base image locally, but again this wouldn't be a bug.

Expected behavior:
I think jib should be using the latest stable version of Jetty, which at the time of writing is 9.4.12.v20180830

Steps to reproduce:
mvn package jib:dockerBuild
docker-compose up
check the line INFO:oejs.Server:main: jetty-9.4.4.v20170414

Environment:
Using the maven plugin. Please let me know if you need more information.

jib-maven-plugin Configuration:

<dependencies>
        <!-- https://mvnrepository.com/artifact/com.google.cloud.tools/jib-maven-plugin -->
        <dependency>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>jib-maven-plugin</artifactId>
            <version>0.10.0</version>
        </dependency>
...
     </dependencies>

<build>
        <defaultGoal>spring-boot:run</defaultGoal>
        <plugins>
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>0.10.0</version>
                <configuration>
                    <to>
                        <image>MYCONTAINERREGISTRY</image>
                    </to>
                </configuration>
            </plugin>
...
</build>

(I'm assuming MYCONTAINERREGISTRY is properly set up, since I can pull and push images)

Log output:
INFO:oejs.Server:main: jetty-9.4.4.v20170414

Additional Information:
I'm using JHipster to build my application. It doesn't use an installed version of maven, but rather a maven wrapper they themselves provide. Probably not relevant.

Thanks.

@chanseokoh
Copy link
Member

Yeah, this is a known issue, and we should update the Jetty version in the distroless image. In the meantime, you may want to set a different Servlet engine image as a base image.

@guilleojeda
Copy link
Author

@chanseokoh If I can help with the distroless image, let me know. Otherwise, yeah, I'd like to set a different Servlet engine image as a base image. How can I do that? Would a regular image of a newer version of Jetty work, or does the distroless image add something to Jetty?

@chanseokoh
Copy link
Member

@kblueriver check the following to get the hint to use a different base image for WAR: https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin#war-projects
You may need to adjust <appRoot> and <entrypoint>.

@chanseokoh
Copy link
Member

Would a regular image of a newer version of Jetty work, or does the distroless image add something to Jetty?

FYI, the Jetty distroless image is nothing special other than Jetty 9.4.4 is installed at /jetty (hence the webapps directory is at /jetty/webapps), and the container will start with /usr/bin/java -jar /jetty/start.jar (base image's ENTRYPOINT set to /usr/bin/java -jar and CMD set to /jetty/start.jar). Jib will by default explode a project WAR into /jetty/webapps/ROOT and inherit ENTRYPOINT and CMD, and starting Jetty will automatically pick up the webapp.

@briandealwis
Copy link
Member

Opened GoogleContainerTools/distroless#254 and closing this 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

3 participants