From 214341296dd3570008f19164a1259637ac86fa9a Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Wed, 11 Mar 2015 13:47:57 -0700 Subject: [PATCH 1/2] Document changes to allow Jetty to run --read-only --- jetty/README.md | 12 ++++++++++-- jetty/content.md | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/jetty/README.md b/jetty/README.md index 4a311f99..7361d4de 100644 --- a/jetty/README.md +++ b/jetty/README.md @@ -30,13 +30,21 @@ The default Jetty environment in the image is: JETTY_HOME = /usr/local/jetty JETTY_BASE = /var/lib/jetty JETTY_CONF = /usr/local/jetty/etc/jetty.conf - JETTY_STATE = /var/lib/jetty/jetty.state + JETTY_STATE = /run/jetty/jetty.state JETTY_ARGS = JAVA_OPTIONS = - TMPDIR = /tmp + TMPDIR = /tmp/jetty Webapps can be [deployed](https://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications) in `/var/lib/jetty/webapps`. +## Read-only container + +To run `jetty` as a read-only container, have Docker create the `/tmp/jetty` and `/run/jetty` directories as volumes: + + docker run -d --read-only -v /tmp/jetty -v /run/jetty jetty:9 + +Since the container is read-only, you'll need to either mount in your webapps directory with `-v /path/to/my/webapps:/var/lib/jetty/webapps` or by populating `/var/lib/jetty/webapps` in a derived image. + # Security By default, this image starts as user `root` and uses Jetty's `setuid` module to drop privileges to user `jetty` after initialization. The `JETTY_BASE` directory at `/var/lib/jetty` is owned by `jetty:jetty` (uid 999, gid 999). diff --git a/jetty/content.md b/jetty/content.md index 88d0f4fe..577723b0 100644 --- a/jetty/content.md +++ b/jetty/content.md @@ -23,13 +23,21 @@ The default Jetty environment in the image is: JETTY_HOME = /usr/local/jetty JETTY_BASE = /var/lib/jetty JETTY_CONF = /usr/local/jetty/etc/jetty.conf - JETTY_STATE = /var/lib/jetty/jetty.state + JETTY_STATE = /run/jetty/jetty.state JETTY_ARGS = JAVA_OPTIONS = - TMPDIR = /tmp + TMPDIR = /tmp/jetty Webapps can be [deployed](https://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications) in `/var/lib/jetty/webapps`. +## Read-only container + +To run `jetty` as a read-only container, have Docker create the `/tmp/jetty` and `/run/jetty` directories as volumes: + + docker run -d --read-only -v /tmp/jetty -v /run/jetty jetty:9 + +Since the container is read-only, you'll need to either mount in your webapps directory with `-v /path/to/my/webapps:/var/lib/jetty/webapps` or by populating `/var/lib/jetty/webapps` in a derived image. + # Security By default, this image starts as user `root` and uses Jetty's `setuid` module to drop privileges to user `jetty` after initialization. The `JETTY_BASE` directory at `/var/lib/jetty` is owned by `jetty:jetty` (uid 999, gid 999). From 2ca2bf6676d0b742d5767d8ac3c9a72a5d3fe67a Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Wed, 11 Mar 2015 14:50:17 -0700 Subject: [PATCH 2/2] Run update.sh jetty --- jetty/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty/README.md b/jetty/README.md index 7361d4de..6307d700 100644 --- a/jetty/README.md +++ b/jetty/README.md @@ -1,7 +1,7 @@ # Supported tags and respective `Dockerfile` links -- [`9.2.9-jre7`, `9.2-jre7`, `9-jre7`, `jre7`, `9.2.9`, `9.2`, `9`, `latest` (*9-jre7/Dockerfile*)](https://github.com/md5/docker-jetty/blob/4ad6b737e903f54b1ed529ab1c9afe9c6d8fde05/9-jre7/Dockerfile) -- [`9.2.9-jre8`, `9.2-jre8`, `9-jre8`, `jre8` (*9-jre8/Dockerfile*)](https://github.com/md5/docker-jetty/blob/4ad6b737e903f54b1ed529ab1c9afe9c6d8fde05/9-jre8/Dockerfile) +- [`9.2.9-jre7`, `9.2-jre7`, `9-jre7`, `jre7`, `9.2.9`, `9.2`, `9`, `latest` (*9-jre7/Dockerfile*)](https://github.com/md5/docker-jetty/blob/346cf67904dc0e0e0a47ea7796baa769ad76e4b1/9-jre7/Dockerfile) +- [`9.2.9-jre8`, `9.2-jre8`, `9-jre8`, `jre8` (*9-jre8/Dockerfile*)](https://github.com/md5/docker-jetty/blob/346cf67904dc0e0e0a47ea7796baa769ad76e4b1/9-jre8/Dockerfile) For more information about this image and its history, please see the [relevant manifest file (`library/jetty`)](https://github.com/docker-library/official-images/blob/master/library/jetty) in the [`docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images).