Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Run setuid as jetty with JETTY_BASE=/var/lib/jetty #4

Merged
merged 1 commit into from Feb 27, 2015
Merged

Conversation

md5
Copy link
Member

@md5 md5 commented Feb 26, 2015

This patch updates the jetty image to take advantage of the JETTY_BASE feature in Jetty 9.1+. Jetty now runs from /var/lib/jetty, which is owned by user jetty.

The /var/lib/jetty directory is created using Jetty's start.jar --add-to-startd functionality based on the list of modules in $JETTY_HOME/start.ini. The Dockerfile then adds Jetty's setuid to direct Jetty to drop privileges after startup.

Fixes #1

@md5
Copy link
Member Author

md5 commented Feb 26, 2015

@tianon @yosifkit thoughts?

@yosifkit
Copy link

That seems reasonable.

@md5
Copy link
Member Author

md5 commented Feb 26, 2015

The image as built by this branch can actually be run directly with -u jetty; the setuid module just has no effect in that case.

The reason I didn't use USER jetty is probably the same reason that (for example) ghost uses gosu instead of USER user, i.e. ease of creating derived images without having to switch back to USER root. In this case, Jetty provides the functionality built-in, so I didn't want to add gosu.

I'm planning to document this stuff and submit PRs for both the image changes and the docs at the same time.

@tianon
Copy link
Contributor

tianon commented Feb 27, 2015

Seems good to me too. Apache and the mysql variations do a similar flow. 👍

md5 added a commit that referenced this pull request Feb 27, 2015
Run setuid as jetty with JETTY_BASE=/var/lib/jetty
@md5 md5 merged commit 9642bfa into master Feb 27, 2015
@md5 md5 deleted the setuid-jetty branch February 27, 2015 01:18
@md5 md5 mentioned this pull request Apr 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run as non-root by default
3 participants