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

Master openjdk 8 9 #44

Closed
Closed
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
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ This repository contains the source for the `gcr.io/google_appengine/jetty` [doc
The layout of this image is intended to mostly mimic the official [docker-jetty](https://github.com/appropriate/docker-jetty) image and unless otherwise noted, the official [docker-jetty documentation](https://github.com/docker-library/docs/tree/master/jetty) should apply.

## Building the Jetty image
To build the image you need git, docker and maven installed and to have the openjdk8:8-jre
To build the image you need git, docker and maven installed and to have the openjdk:8
image available in your docker repository:
```console
git clone https://github.com/GoogleCloudPlatform/jetty-runtime.git
mvn clean install
```

## Running the Jetty image
The resulting image is called jetty9:9.3.5.v20151012 (or the current jetty version as the label)
The resulting image is called jetty:9 (with more specific tags also created)
and can be run with:
```console
docker run jetty9:9.3.5.v20151012
docker run jetty:9
```
## Google Modules & Configuration
The jetty base in this image has some additional google specific modules:
Expand All @@ -37,13 +37,13 @@ The request log also defaults to log into `/var/log/app_engine/` by the
Arguments passed to the docker run command are passed to Jetty, so the
configuration of the jetty server can be seen with a command like:
```console
docker run jetty9:9.3.5.v20151012 --list-config
docker run jetty:9 --list-config
```

Alternate commands can also be passed to the docker run command, so the
image can be explored with
```console
docker run t --rm jetty9:9.3.5.v20151012 bash
docker run -it --rm jetty:9 bash
```

To update the server configuration in a derived Docker image, the `Dockerfile` may
Expand All @@ -52,7 +52,7 @@ enable additional modules with `RUN` commands like:
WORKDIR $JETTY_BASE
RUN java -jar "$JETTY_HOME/start.jar" --add-to-startd=jmx,stats
```
Modules may be configured in a `Dockerfile` by editing the properties in the corresponding `/var/lib/jetty/start.d/*.mod` file or the module can be deactivated by removing that file.
Modules may be configured in a `Dockerfile` by editing the properties in the corresponding mod files in `/var/lib/jetty/start.d/` or the module can be deactivated by removing that file.

## App Engine Flexible Environment
This image works with App Engine Flexible Environment as a custom runtime.
Expand Down Expand Up @@ -80,18 +80,19 @@ The entry point for the image is [docker-entrypoint.bash](https://github.com/Goo

If the default command (java) is used, then the entry point sources the [setup-env.bash](https://github.com/GoogleCloudPlatform/openjdk-runtime/blob/master/openjdk8/src/main/docker/setup-env.bash), which looks for supported features to be enabled and/or configured. The following table indicates the environment variables that may be used to enable/disable/configure features, any default values if they are not set:

|Env Var | Description | Type | Default |
|------------------|---------------------|----------|---------------------------------------|
|`DBG_ENABLE` | Stackdriver Debugger| boolean | `true` |
|`TMPDIR` | Temporary Directory | dirname | |
|`JAVA_TMP_OPTS` | JVM tmpdir args | JVM args | `-Djava.io.tmpdir=${TMPDIR}` |
|`HEAP_SIZE` | Available heap | size | Derived from `/proc/meminfo` |
|`JAVA_HEAP_OPTS` | JVM heap args | JVM args | `-Xms${HEAP_SIZE} -Xmx${HEAP_SIZE}` |
|`JAVA_GC_OPTS` | JVM GC args | JVM args | `-XX:+UseG1GC` plus configuration |
|`JAVA_GC_LOG` | JVM GC log file | filename | |
|`JAVA_GC_LOG_OPTS`| JVM GC args | JVM args | Derived from `$JAVA_GC_LOG` |
|`JAVA_USER_OPTS` | JVM other args | JVM args | |
|`JAVA_OPTS` | JVM args | JVM args | See below |
|Env Var | Description | Type | Default |
|------------------|---------------------|----------|---------------------------------------------|
|`DBG_ENABLE` | Stackdriver Debugger| boolean | `true` |
|`TMPDIR` | Temporary Directory | dirname | |
|`JAVA_TMP_OPTS` | JVM tmpdir args | JVM args | `-Djava.io.tmpdir=${TMPDIR}` |
|`GAE_MEMORY_MB` | Available memory | size | Set by GAE or `/proc/meminfo`-400M |
|`HEAP_SIZE_MB` | Available heap | size | 80% of `${GAE_MEMORY_MB}` |
|`JAVA_HEAP_OPTS` | JVM heap args | JVM args | `-Xms${HEAP_SIZE_MB}M -Xmx${HEAP_SIZE_MB}M` |
|`JAVA_GC_OPTS` | JVM GC args | JVM args | `-XX:+UseG1GC` plus configuration |
|`JAVA_GC_LOG` | JVM GC log file | filename | |
|`JAVA_GC_LOG_OPTS`| JVM GC args | JVM args | Derived from `$JAVA_GC_LOG` |
|`JAVA_USER_OPTS` | JVM other args | JVM args | |
|`JAVA_OPTS` | JVM args | JVM args | See below |

If not explicitly set, `JAVA_OPTS` is defaulted to
```
Expand Down
8 changes: 4 additions & 4 deletions jetty9-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.cloud.runtimes</groupId>
<artifactId>jetty-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Google App Engine Image Jetty (jetty9-base)</name>
Expand All @@ -38,7 +38,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<version>${jetty9.version}</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -90,7 +90,7 @@
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-distribution</artifactId>
<version>${jetty.version}</version>
<version>${jetty9.version}</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<includes>**</includes>
Expand Down Expand Up @@ -134,7 +134,7 @@
<workingDirectory>${project.build.directory}/jetty-base</workingDirectory>
<arguments>
<argument>-jar</argument>
<argument>../jetty-distribution-${jetty.version}/start.jar</argument>
<argument>../jetty-distribution-${jetty9.version}/start.jar</argument>
<argument>--add-to-startd=http,deploy,jsp,jstl,http-forwarded,resources,gae</argument>
</arguments>
</configuration>
Expand Down
24 changes: 17 additions & 7 deletions jetty9/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.cloud.runtimes</groupId>
<artifactId>jetty-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Google App Engine Image Jetty (jetty9)</name>
Expand All @@ -38,7 +38,6 @@
</dependencies>

<build>

<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -79,7 +78,7 @@
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-distribution</artifactId>
<version>${jetty.version}</version>
<version>${jetty9.version}</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<includes>**</includes>
Expand Down Expand Up @@ -123,9 +122,14 @@
<goal>build</goal>
</goals>
<configuration>
<imageName>jetty9</imageName>
<imageName>jetty</imageName>
<imageTags>
<imageTag>${docker.tag}</imageTag>
<imageTag>${docker.tag.prefix}${jetty9.version}-${maven.build.timestamp}</imageTag>
<imageTag>${docker.tag.prefix}${jetty9.version}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}.${jetty9.dot.version}-${maven.build.timestamp}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}.${jetty9.dot.version}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}</imageTag>
<imageTag>${docker.tag.prefix}9</imageTag>
</imageTags>
<dockerDirectory>${project.build.directory}/docker</dockerDirectory>
</configuration>
Expand All @@ -137,9 +141,15 @@
<goal>removeImage</goal>
</goals>
<configuration>
<imageName>jetty9</imageName>
<imageName>jetty</imageName>
<imageTags>
<imageTag>${docker.tag}</imageTag>
<imageTag>${docker.tag.prefix}${jetty9.version}-${maven.build.timestamp}</imageTag>
<imageTag>${docker.tag.prefix}${jetty9.version}</imageTag>
<imageTag>${docker.tag.prefix}${jetty9.base.version}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}.${jetty9.dot.version}-${maven.build.timestamp}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}.${jetty9.dot.version}</imageTag>
<imageTag>${docker.tag.prefix}9.${jetty9.minor.version}</imageTag>
<imageTag>${docker.tag.prefix}9</imageTag>
</imageTags>
</configuration>
</execution>
Expand Down
4 changes: 2 additions & 2 deletions jetty9/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ RUN groupadd -r jetty \
&& useradd -r -g jetty jetty

# Create env vars to identify image
ENV JETTY_VERSION ${jetty9.version}
ENV GAE_IMAGE_NAME ${project.artifactId}
ENV GAE_IMAGE_LABEL ${docker.tag}
ENV GAE_IMAGE_VERSION ${project.version}
ENV GAE_IMAGE_LABEL ${docker.tag.prefix}${jetty9.version}-${maven.build.timestamp}

# Create Jetty Home
ENV JETTY_HOME /usr/local/jetty
Expand Down
14 changes: 9 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>com.google.cloud.runtimes</groupId>
<artifactId>jetty-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Google App Engine Jetty Runtime Parent</name>
<scm>
Expand All @@ -32,11 +32,15 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<jetty.version>9.3.8.v20160314</jetty.version>
<maven.build.timestamp.format>yyyy-MM-dd_HH_mm</maven.build.timestamp.format>
<appengine.api.version>1.9.40</appengine.api.version>
<docker.tag>${jetty.version}</docker.tag>
<docker.openjdk.image>openjdk8:8-jre</docker.openjdk.image>
<jetty9.minor.version>3</jetty9.minor.version>
<jetty9.dot.version>8</jetty9.dot.version>
<jetty9.version>9.${jetty9.minor.version}.${jetty9.dot.version}.v20160314</jetty9.version>
<docker.tag.prefix></docker.tag.prefix>

<!-- TODO depend on specific released version of openjdk -->
<docker.openjdk.image>openjdk:8u102</docker.openjdk.image>
</properties>

<developers>
Expand Down