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

Document WAR containerization with jetty #3205

Merged
merged 4 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jib-gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ The Jib build plugins have an extension framework that enables anyone to easily

### WAR Projects

Jib also containerizes WAR projects. If the Gradle project uses the [WAR Plugin](https://docs.gradle.org/current/userguide/war_plugin.html), Jib will by default use [jetty](https://hub.docker.com/_/jetty) as a base image to deploy the project WAR. No extra configuration is necessary other than using the WAR Plugin to make Jib build WAR images.
Jib also containerizes WAR projects. If the Gradle project uses the [WAR Plugin](https://docs.gradle.org/current/userguide/war_plugin.html), Jib will by default use [`jetty`](https://hub.docker.com/_/jetty) as a base image to deploy the project WAR. No extra configuration is necessary other than using the WAR Plugin to make Jib build WAR images.

Note that Jib will work slightly differently for WAR projects from JAR projects:
- `container.mainClass` and `container.jvmFlags` are ignored.
Expand All @@ -541,6 +541,14 @@ jib {
container.appRoot = '/usr/local/tomcat/webapps/ROOT'
}
```
When specifying a [`jetty`](https://hub.docker.com/_/jetty) image yourself with `from.image`, you may run into an issue ([#3204](https://github.com/GoogleContainerTools/jib/issues/3204)) and need to override the entrypoint.
```gradle
jib {
from.image = 'jetty:11.0.2-jre11'
container.entrypoint = ['java', '-jar', '/usr/local/jetty/start.jar']
}
```


### Skaffold Integration

Expand Down
14 changes: 13 additions & 1 deletion jib-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ The Jib build plugins have an extension framework that enables anyone to easily

### WAR Projects

Jib also containerizes WAR projects. If the Maven project uses [the `war`-packaging type](https://maven.apache.org/plugins/maven-war-plugin/index.html), Jib will by default use [jetty](https://hub.docker.com/_/jetty) as a base image to deploy the project WAR. No extra configuration is necessary other than having the packaging type to `war`.
Jib also containerizes WAR projects. If the Maven project uses [the `war`-packaging type](https://maven.apache.org/plugins/maven-war-plugin/index.html), Jib will by default use [`jetty`](https://hub.docker.com/_/jetty) as a base image to deploy the project WAR. No extra configuration is necessary other than having the packaging type to `war`.

Note that Jib will work slightly differently for WAR projects from JAR projects:
- `<container><mainClass>` and `<container><jvmFlags>` are ignored.
Expand All @@ -655,6 +655,18 @@ To use a different Servlet engine base image, you can customize `<container><app
</container>
</configuration>
```
When specifying a [`jetty`](https://hub.docker.com/_/jetty) image yourself with `<from><image>`, you may run into an issue ([#3204](https://github.com/GoogleContainerTools/jib/issues/3204)) and need to override the entrypoint.
```xml
<configuration>
<from>
<image>jetty:11.0.2-jre11</image>
</from>
<container>
<entrypoint>java,-jar,/usr/local/jetty/start.jar</entrypoint>
</container>
</configuration>
```


### Skaffold Integration

Expand Down