diff --git a/Dockerfile b/Dockerfile index 152a6bd..dd099c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ ENV GS_VERSION=${GS_VERSION} \ INITIAL_MEMORY="2G" \ MAXIMUM_MEMORY="4G" \ JAIEXT_ENABLED=true \ + DOWNLOAD_EXTENSIONS=false \ STABLE_EXTENSIONS='' \ DEBIAN_FRONTEND=noninteractive \ EXTENSION_DOWNLOAD_DIR=/opt/geoserver_extension_downloads \ diff --git a/README.md b/README.md index 1492caf..34c3a65 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Pass as environment variables. If not passed, the default values will be used. * `INITIAL_MEMORY` (default: 2G) * `MAXIMUM_MEMORY` (default: 4G) * `JAIEXT_ENABLED` (default: true) +* `DOWNLOAD_EXTENSIONS` (default: false) * `STABLE_EXTENSIONS` as comma separated list, will be downloaded and installed on startup (default: "") ## TODOs diff --git a/docker-compose-demo.yml b/docker-compose-demo.yml index 58c017a..9b23ceb 100644 --- a/docker-compose-demo.yml +++ b/docker-compose-demo.yml @@ -6,6 +6,7 @@ services: ports: - 8080:8080 environment: + - DOWNLOAD_EXTENSIONS=true - STABLE_EXTENSIONS=wps - INITIAL_MEMORY=1G - MAXIMUM_MEMORY=2G diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index b545daa..e49359f 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -3,9 +3,7 @@ set -e ## install GeoServer extensions before starting the tomcat -echo "Starting installation of extensions" /scripts/install-extensions.sh -echo "\nFinished installation of extensions" export GEOSERVER_OPTS="-Djava.awt.headless=true -server \ -Dfile.encoding=UTF8 \ diff --git a/scripts/install-extensions.sh b/scripts/install-extensions.sh index 00f2bf6..72d7bc2 100644 --- a/scripts/install-extensions.sh +++ b/scripts/install-extensions.sh @@ -14,8 +14,12 @@ function download_extension() { fi } -# Install stable plugins -for EXTENSION in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do - URL="${STABLE_PLUGIN_URL}/geoserver-${GS_VERSION}-${EXTENSION}-plugin.zip" - download_extension ${URL} ${EXTENSION} -done +# Install stable plugins only if DOWNLOAD_EXTENSIONS is true +if [ "$DOWNLOAD_EXTENSIONS" = "true" ]; then + echo "Starting installation of extensions" + for EXTENSION in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do + URL="${STABLE_PLUGIN_URL}/geoserver-${GS_VERSION}-${EXTENSION}-plugin.zip" + download_extension ${URL} ${EXTENSION} + done + echo "Finished installation of extensions" +fi