Skip to content

Commit

Permalink
Rename image from jetty9 to jetty (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
meltsufin authored Sep 26, 2016
1 parent b29698e commit 746eb6a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 34 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ 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
cd jetty-runtime
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 (with more specific tags also created)
and can be run with:
```console
docker run jetty9:9.3.5.v20151012
docker run jetty
```
## Google Modules & Configuration
The jetty base in this image has some additional google specific modules:
Expand All @@ -37,13 +38,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 --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 bash
```

To update the server configuration in a derived Docker image, the `Dockerfile` may
Expand All @@ -52,7 +53,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 +81,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
6 changes: 3 additions & 3 deletions jetty9-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 7 additions & 6 deletions jetty9/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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,10 @@
<goal>build</goal>
</goals>
<configuration>
<imageName>jetty9</imageName>
<imageName>jetty</imageName>
<imageTags>
<imageTag>${docker.tag}</imageTag>
<imageTag>${docker.tag.short}</imageTag>
<imageTag>${docker.tag.long}</imageTag>
</imageTags>
<dockerDirectory>${project.build.directory}/docker</dockerDirectory>
</configuration>
Expand All @@ -137,9 +137,10 @@
<goal>removeImage</goal>
</goals>
<configuration>
<imageName>jetty9</imageName>
<imageName>jetty</imageName>
<imageTags>
<imageTag>${docker.tag}</imageTag>
<imageTag>${docker.tag.short}</imageTag>
<imageTag>${docker.tag.long}</imageTag>
</imageTags>
</configuration>
</execution>
Expand Down
6 changes: 3 additions & 3 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 GAE_IMAGE_NAME ${project.artifactId}
ENV GAE_IMAGE_LABEL ${docker.tag}
ENV GAE_IMAGE_VERSION ${project.version}
ENV JETTY_VERSION ${jetty9.version}
ENV GAE_IMAGE_NAME jetty
ENV GAE_IMAGE_LABEL ${docker.tag.long}

# Create Jetty Home
ENV JETTY_HOME /usr/local/jetty
Expand Down
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
<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>

This comment has been minimized.

Copy link
@joakime

joakime Sep 28, 2016

Contributor

This renders many plugins and third party libraries invalid.

Advice: May only contain lowercase letters, digits, and hyphens. Must begin and end with a letter or digit. Must not exceed 63 characters.

If at all possible, do not change the maven.build.timestamp.format

This comment has been minimized.

Copy link
@gregw

gregw Sep 28, 2016

Contributor

Ah, I guess the issue here is that the maven.build.timestamp formats the timestamp for all the snapshots etc.
So we can either just use the default maven timestamp for our labels, or we need to format just the label timestamp and not the maven one?

<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>
<docker.tag.short>${docker.tag.prefix}9.${jetty9.minor.version}</docker.tag.short>
<docker.tag.long>${docker.tag.prefix}9.${jetty9.minor.version}-${maven.build.timestamp}</docker.tag.long>

<docker.openjdk.image>openjdk:8</docker.openjdk.image>
</properties>

<developers>
Expand Down

0 comments on commit 746eb6a

Please sign in to comment.