forked from appropriate/docker-jetty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request appropriate#32 from hypnoce/alpine
Add alpine-base images
- Loading branch information
Showing
13 changed files
with
200 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
FROM java:8-jre-alpine | ||
|
||
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | ||
RUN addgroup -S jetty && adduser -D -S -H -G jetty jetty && rm -rf /etc/group- /etc/passwd- /etc/shadow- | ||
|
||
ENV JETTY_HOME /usr/local/jetty | ||
ENV PATH $JETTY_HOME/bin:$PATH | ||
RUN mkdir -p "$JETTY_HOME" | ||
WORKDIR $JETTY_HOME | ||
|
||
ENV JETTY_BASE /var/lib/jetty | ||
RUN mkdir -p "$JETTY_BASE" | ||
|
||
ENV JETTY_VERSION 9.3.9.v20160517 | ||
ENV JETTY_TGZ_URL https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/$JETTY_VERSION/jetty-distribution-$JETTY_VERSION.tar.gz | ||
|
||
# GPG Keys are personal keys of Jetty committers (see https://dev.eclipse.org/mhonarc/lists/jetty-users/msg05220.html) | ||
ENV JETTY_GPG_KEYS \ | ||
# 1024D/8FB67BAC 2006-12-10 Joakim Erdfelt <[email protected]> | ||
B59B67FD7904984367F931800818D9D68FB67BAC \ | ||
# 1024D/D7C58886 2010-03-09 Jesse McConnell (signing key) <[email protected]> | ||
5DE533CB43DAF8BC3E372283E7AE839CD7C58886 | ||
RUN set -xe \ | ||
|
||
# Install required packages for build time. Will be removed when build finishes. | ||
&& apk add --no-cache --virtual .build-deps gnupg coreutils curl \ | ||
|
||
&& curl -SL "$JETTY_TGZ_URL" -o jetty.tar.gz \ | ||
&& curl -SL "$JETTY_TGZ_URL.asc" -o jetty.tar.gz.asc \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& for key in $JETTY_GPG_KEYS; do \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done \ | ||
&& gpg --batch --verify jetty.tar.gz.asc jetty.tar.gz \ | ||
&& rm -r "$GNUPGHOME" \ | ||
&& tar -xvzf jetty.tar.gz \ | ||
&& mv jetty-distribution-$JETTY_VERSION/* ./ \ | ||
&& sed -i '/jetty-logging/d' etc/jetty.conf \ | ||
&& rm -fr demo-base javadoc \ | ||
&& rm jetty.tar.gz* \ | ||
&& rm -fr jetty-distribution-$JETTY_VERSION/ \ | ||
|
||
# Get the list of modules in the default start.ini and build new base with those modules, then add setuid | ||
&& cd $JETTY_BASE \ | ||
&& modules="$(grep -- ^--module= "$JETTY_HOME/start.ini" | cut -d= -f2 | paste -d, -s)" \ | ||
&& java -jar "$JETTY_HOME/start.jar" --add-to-startd="$modules,setuid" \ | ||
|
||
# Remove installed packages and various cleanup | ||
&& apk del .build-deps \ | ||
&& rm -fr .build-deps \ | ||
&& rm -rf /tmp/hsperfdata_root | ||
|
||
WORKDIR $JETTY_BASE | ||
|
||
ENV JETTY_RUN /run/jetty | ||
ENV JETTY_STATE $JETTY_RUN/jetty.state | ||
ENV TMPDIR /tmp/jetty | ||
RUN set -xe \ | ||
&& mkdir -p "$JETTY_RUN" "$TMPDIR" \ | ||
&& chown -R jetty:jetty "$JETTY_RUN" "$TMPDIR" "$JETTY_BASE" | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["java","-Djava.io.tmpdir=/tmp/jetty","-jar","/usr/local/jetty/start.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ "$1" = jetty.sh ]; then | ||
if ! command -v bash >/dev/null 2>&1 ; then | ||
cat >&2 <<- 'EOWARN' | ||
******************************************************************** | ||
ERROR: bash not found. Use of jetty.sh requires bash. | ||
******************************************************************** | ||
EOWARN | ||
exit 1 | ||
fi | ||
cat >&2 <<- 'EOWARN' | ||
******************************************************************** | ||
WARNING: Use of jetty.sh from this image is deprecated and may | ||
be removed at some point in the future. | ||
See the documentation for guidance on extending this image: | ||
https://github.com/docker-library/docs/tree/master/jetty | ||
******************************************************************** | ||
EOWARN | ||
fi | ||
|
||
if ! command -v -- "$1" >/dev/null 2>&1 ; then | ||
set -- java -jar "-Djava.io.tmpdir=$TMPDIR" "$JETTY_HOME/start.jar" "$@" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters