Browse Source

Document changes to allow Jetty to run --read-only

Mike Dillon 10 years ago
parent
commit
214341296d
2 changed files with 20 additions and 4 deletions
  1. 10 2
      jetty/README.md
  2. 10 2
      jetty/content.md

+ 10 - 2
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).

+ 10 - 2
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).