Coder Social home page Coder Social logo

docker-geoserver's Introduction

Table of Contents

Kartoza docker-geoserver

  • A simple docker container that runs GeoServer influenced by this docker recipe.
  • The image has environment variables that allow users to configure GeoServer based on running-in-production
  • The image uses kartoza/postgis as a database backend. You can use any other PostgreSQL image out there but make sure you adjust the environment variables accordingly.

Getting the image

There are various ways to get the image onto your system:

  • Pulling from Dockerhub
  • Local build using docker-compose

Pulling from Dockerhub

The preferred way (but using the most bandwidth for the initial image) is to get our docker-trusted build like this:

VERSION=2.25.1
docker pull kartoza/geoserver:$VERSION

Note Although the images are tagged and backed by unit tests it is recommended to use tagged versions with dates i.e. kartoza/geoserver:$VERSION--v2024.03.31.The first date available from dockerhub would be the first version for that series. Successive builds that fix issues tend to override the tagged images and also produce dated images.

Building the image

Local build using repository checkout

To build yourself with a local checkout using the docker-compose-build.yml:

  1. Clone the GitHub repository:

    git clone https://github.com/kartoza/docker-geoserver
  2. Edit the build arguments in the .env file:

  3. Build the container and spin up the services

    cd docker-geoserver
    docker-compose -f docker-compose-build.yml up -d geoserver-prod --build

Building with a specific version of Tomcat

To build using a specific tagged release of the tomcat image set the IMAGE_VERSION build arg: See the dockerhub tomcat for available tags.

VERSION=2.25.1
IMAGE_VERSION=9.0.85-jdk17-temurin-focal
docker build --build-arg IMAGE_VERSION=${IMAGE_VERSION} --build-arg GS_VERSION=${VERSION} -t kartoza/geoserver:${VERSION} .

For some recent builds, it is necessary to set the JAVA_PATH as well (e.g. Apache Tomcat/9.0.36)

docker build --build-arg IMAGE_VERSION=9-jdk11-openjdk-slim --build-arg JAVA_HOME=/usr/local/openjdk-11/bin/java --build-arg GS_VERSION=2.25.1 -t kartoza/geoserver:2.25.1 .

Note: Please check the GeoServer documentation to see which Tomcat versions are supported.

We currently build the image using tomcat:9.0.73-jdk11-temurin-focal because libgdal-java is no longer being built and support in base images > focal will not have the java bindings for the GDAL plugin.

Building on Windows

These instructions detail the recommended process for reliably building this on Windows.

Prerequisites - You will need to have this software preinstalled on the system being used to build the Geoserver image:

  • Docker Desktop with WSL2
  • Java JDK
  • Conda
  • GDAL (Install with Conda)

Add the conda-forge channel to your conda installation:

conda config --add channels conda-forge

Now create a new conda environment with GDAL, installed from conda. Ensure that this environment is active when running the docker build, e.g.

conda create -n geoserver-build -c conda-forge python gdal
conda activate geoserver-build

Modify the .env with the appropriate environment variables. It is recommended that short paths (without whitespace) are used with forward slashes to prevent errors. You can get the current Java command short path with PowerShell:

(New-Object -ComObject Scripting.FileSystemObject).GetFile((get-command java).Source).ShortPath

Running the above command should yield a path similar to C:/PROGRA~1/Java/JDK-15~1.2/bin/java.exe, which can be assigned to JAVA_HOME in the environment configuration file.

Then run the docker build commands. If you encounter issues, you may want to ensure that you try to build the image without the cache and then run docker up separately:

docker-compose -f docker-compose-build.yml build --force-rm --no-cache
docker-compose -f docker-compose-build.yml up -d

Environment Variables

A full list of environment variables are specified in the .env file

Default installed extensions

The image ships with the following stable extensions:

  • vectortiles-plugin
  • wps-plugin
  • printing-plugin
  • libjpeg-turbo-plugin
  • control-flow-plugin
  • pyramid-plugin
  • gdal-plugin
  • monitor-plugin
  • inspire-plugin
  • csw-plugin

These extensions are automatically activated on container start.

Activate stable extensions during the contain startup

The environment variable STABLE_EXTENSIONS can be used to activate extensions listed as stable_plugins

Example

ie VERSION=2.25.1
docker run -d -p 8600:8080 --name geoserver -e STABLE_EXTENSIONS=charts-plugin,db2-plugin kartoza/geoserver:${VERSION}

You can pass any comma-separated extensions as defined in the text file stable_plugins

Note If the extension you are looking for is not listed in stable_plugins.txt but is available on the GeoServer list you can still pass it as an environment variable and it will be downloaded on container startup. This might delay GeoServer startup depending on your bandwidth speed.

Activate community extensions during contain startup

The environment variable COMMUNITY_EXTENSIONS can be used to activate extensions listed in community_plugins.txt

Example

ie VERSION=2.25.1
docker run -d -p 8600:8080 --name geoserver -e COMMUNITY_EXTENSIONS=gwc-sqlite-plugin,ogr-datastore-plugin kartoza/geoserver:${VERSION}

The image ships with extension zip files pre-downloaded. You can pass an additional environment variable FORCE_DOWNLOAD_COMMUNITY_EXTENSIONS=true to download the latest community extensions during the initialisation of the container.

Note: If you experience an issue running community extensions please check upstream before reporting the issue here. If an extension is no longer available you can build the extensions following the guidelines from GeoServer develop guidelines

Using sample data

Geoserver ships with sample data which can be used by users to familiarize them with software. This is not activated by default. You can activate it using the environment variable SAMPLE_DATA=true

ie VERSION=2.25.1
docker run -d -p 8600:8080 --name geoserver -e SAMPLE_DATA=true kartoza/geoserver:${VERSION}

Enable disk quota storage in PostgreSQL backend

GeoServer defaults to using HSQL datastore for configuring disk quota. You can alternatively use a PostgreSQL backend as a disk quota store.

You will need to run a PostgreSQL DB and link it to a GeoServer instance.

If you want to test it locally with docker-compose postgres db you need to specify these env variables:

DB_BACKEND=POSTGRES               
HOST=db                          
POSTGRES_PORT=5432                
POSTGRES_DB=gwc                   
POSTGRES_USER=${POSTGRES_USER}    
POSTGRES_PASS=${POSTGRES_PASS}    
SSL_MODE=allow                    
POSTGRES_SCHEMA=public           
DISK_QUOTA_SIZE=5 

Using SSL and Default PostgreSQL SSL certificates (kartoza/postgis backend)

When the environment variable FORCE_SSL=TRUE is set for the database container you will need to set SSL_MODE=allow in the GeoServer container.

Using SSL certificates signed by a certificate authority (kartoza/postgis backend)

When the environment variable FORCE_SSL=TRUE is set for the database container you will need to set SSL_MODE to either verify-full or verify-ca for the GeoServer container. You will also need to mount the SSL certificates you have done in the DB.

In the GeoServer container, the certificates need to be mounted to the folder specified by the certificate directory ${CERT_DIR}

SSL_CERT_FILE=/etc/certs/fullchain.pem
SSL_KEY_FILE=/etc/certs/privkey.pem
SSL_CA_FILE=/etc/certs/root.crt

Activating JNDI PostgreSQL connector

When defining vector stores you can use the JNDI pooling. To set this up you will need to activate the following environment variable POSTGRES_JNDI=TRUE. By default, the environment the variable is set to FALSE. Additionally, you will need to define parameters to connect to an existing PostgreSQL database

POSTGRES_JNDI=TRUE
HOST=${POSTGRES_HOSTNAME}
POSTGRES_DB=${POSTGRES_DB}
POSTGRES_USER=${POSTGRES_USER}
POSTGRES_PASS=${POSTGRES_PASS}

When defining the parameters for the store in GeoServer you will need to set jndiReferenceName=java:comp/env/jdbc/postgres

Running under SSL

You can use the environment variables to specify whether you want to run the GeoServer under SSL. Credits to letsencrpt for providing the solution to run under SSL.

If you set the environment variable SSL=true but do not provide the pem files (fullchain.pem and privkey.pem) the container will generate self-signed SSL certificates.

ie VERSION=2.25.1
docker run -it --name geoserver  -e PKCS12_PASSWORD=geoserver -e JKS_KEY_PASSWORD=geoserver -e JKS_STORE_PASSWORD=geoserver -e SSL=true -p 8443:8443 -p 8600:8080 kartoza/geoserver:${VERSION}

If you already have your perm files (fullchain.pem and privkey.pem) you can mount the directory containing your keys as:

ie VERSION=2.25.1
docker run -it --name geo -v /etc/certs:/etc/certs  -e PKCS12_PASSWORD=geoserver -e JKS_KEY_PASSWORD=geoserver -e JKS_STORE_PASSWORD=geoserver -e SSL=true -p 8443:8443 -p 8600:8080 kartoza/geoserver:${VERSION}

You can also use a PFX file with this image. Rename your PFX file as certificate.pfx and then mount the folder containing your pfx file. This will be converted to perm files.

Note When using PFX files make sure that the ALIAS_KEY you specify as an environment variable matches the ALIAS_KEY that was used when generating your PFX key.

A full list of SSL variables is provided in SSL Settings

Proxy Base URL

For the server to report a full proxy base URL, you need to pass the following env variable i.e.

HTTP_PROXY_NAME
HTTP_PROXY_PORT

If you are running GeoServer under SSL with reverse proxy i.e. nginx you will need to set the following env variables

Example below:

HTTP_PROXY_NAME=foo.org
HTTP_SCHEME=https

This will prevent the login form from sending insecure http post requests as experienced in login issue

For SSL-based connections the env variables are:

HTTPS_PROXY_NAME
HTTPS_PROXY_PORT
HTTPS_SCHEME

Removing Tomcat extras

To include Tomcat extras including docs, examples, and the manager web app, set the TOMCAT_EXTRAS environment variable to true:

Note: If TOMCAT_EXTRAS is set to true then you should configure TOMCAT_PASSWORD to use a strong password otherwise a randomly generated password is used.

ie VERSION=2.25.1
docker run -it --name geoserver  -e TOMCAT_EXTRAS=true -p 8600:8080 kartoza/geoserver:${VERSION}

Note: If TOMCAT_EXTRAS is set to false, requests to the root webapp ("/") will return HTTP status code 404. To issue a redirect to the GeoServer webapp ("/geoserver/web") set ROOT_WEBAPP_REDIRECT=true

Upgrading the image to use a specific version

If you are migrating your GeoServer instance, from one to a lower version to a higher and do not need to update your master password, you will need to set the variable EXISTING_DATA_DIR.

You can set the env variable EXISTING_DATA_DIR to any value i.e. EXISTING_DATA_DIR=foo or EXISTING_DATA_DIR=false When the environment variable is set it will ensure that the password initialization is skipped during the startup procedure.

Installing extra fonts

If you have downloaded extra fonts you can mount the folder to the path /opt/fonts. This will ensure that all the .ttf files are copied to the correct path during initialisation.

ie VERSION=2.25.1
docker run -v fonts:/opt/fonts -p 8080:8080 -t kartoza/geoserver:${VERSION}

Other Environment variables supported

You can find a full list of environment variables in Generic Env variables

Note The list below is not exhaustive of all values available. Always consult the .env file to check possible values.

  • GEOSERVER_DATA_DIR=PATH
  • ENABLE_JSONP=true or false
  • MAX_FILTER_RULES=Any integer
  • OPTIMIZE_LINE_WIDTH=false or true
  • FOOTPRINTS_DATA_DIR=PATH
  • GEOWEBCACHE_CACHE_DIR=PATH
  • GEOSERVER_ADMIN_PASSWORD=password
  • GEOSERVER_ADMIN_USER=username
  • GEOSERVER_FILEBROWSER_HIDEFS=false or true
  • XFRAME_OPTIONS="true" - Based on Xframe-options
  • INITIAL_MEMORY=size : Initial Memory that Java can allocate, default 2G
  • MAXIMUM_MEMORY=size : Maximum Memory that Java can allocate, default 4G

Control flow properties

The control flow module manages requests in GeoServer. Instructions on what each parameter means can be read from documentation.

The following env variables can be set

REQUEST_TIMEOUT=60
PARALLEL_REQUEST=100
GETMAP=10
REQUEST_EXCEL=4
SINGLE_USER=6
GWC_REQUEST=16
WPS_REQUEST=1000/d;30s

Changing GeoServer password and username

You can pass the environment variables to change it on runtime.

GEOSERVER_ADMIN_PASSWORD
GEOSERVER_ADMIN_USER

The username and password are reinitialized each time the container starts. If you do not pass the env variables GEOSERVER_ADMIN_PASSWORD the container will generate a new password which is visible in the startup logs.

Note: When upgrading the GEOSERVER_ADMIN_PASSWORD and GEOSERVER_ADMIN_USER you will need to mount the volume settings:/settings so that the lock-files generated by the update_password.sh are persistent during initialization. See the example in docker-compose-build

docker run --name "geoserver" -e GEOSERVER_ADMIN_USER=kartoza  -e GEOSERVER_ADMIN_PASSWORD=myawesomegeoserver -p 8080:8080 -d -t kartoza/geoserver

Note: The docker-compose recipe uses the password myawesomegeoserver. It is highly recommended not to run the container in production using these values.

Docker secrets

To avoid passing sensitive information in environment variables, _FILE can be appended to some variables to read from files present in the container. This is particularly useful in conjunction with Docker secrets, as passwords can be loaded from /run/secrets/<secret_name> e.g.:

  • -e GEOSERVER_ADMIN_PASSWORD_FILE=/run/secrets/<geoserver_pass_secret>

For more information see https://docs.docker.com/engine/swarm/secrets/.

Currently, the following environment variables

 GEOSERVER_ADMIN_USER
 GEOSERVER_ADMIN_PASSWORD
 S3_USERNAME
 S3_PASSWORD
 TOMCAT_USER
 TOMCAT_PASSWORD
 PKCS12_PASSWORD
 JKS_KEY_PASSWORD
 JKS_STORE_PASSWORD

are supported.

Changing GeoServer deployment context-root

You can pass the environment variable to change the context-root at runtime, example:

GEOSERVER_CONTEXT_ROOT=my-geoserver

The example above will deploy Geoserver at https://host/my-geoserver instead of the default location at https://host/geoserver.

It is also possible to do a nested context-root. Apache Tomcat nested context-roots are specified via #.

GEOSERVER_CONTEXT_ROOT=foo#my-geoserver

The example above will deploy Geoserver at https://host/foo/my-geoserver instead of the default location at https://host/geoserver.

This variable is meant for runtime only. At build-time, do not change this value so at runtime it can perform the proper context-root rename.

Mounting Configs

You can mount the config file to the path /settings. These configs will be used in favour of the defaults that are available from the Build data directory

The configs that can be mounted are

  • cluster.properties
  • controlflow.properties
  • embedded-broker.properties
  • geowebcache-diskquota-jdbc.xml
  • s3.properties
  • tomcat-users.xml
  • web.xml - for tomcat cors
  • epsg.properties - for custom GeoServer EPSG values
  • server.xml - for tomcat configurations
  • broker.xml
  • users.xml - for Geoserver users.
  • roles.xml - To define roles users should have in GeoServer

Example

 docker run --name "geoserver" -e GEOSERVER_ADMIN_USER=kartoza  -v /data/controlflow.properties:/settings/controlflow.properties -p 8080:8080 -d -t kartoza/geoserver

Note: The files users.xml and roles.xml should be mounted together to prevent errors during container start. Mounting these two files will overwrite GEOSERVER_ADMIN_PASSWORD and GEOSERVER_ADMIN_USER

You can additionally run some bash script to correct some missing dependencies i.e. in community extension like cluster issue

-v ./run.sh:/docker-entrypoint-geoserver.d/run.sh

CORS Support

The image ships with CORS support. If you however need to modify the web.xml you can mount web.xml to /settings/ directory.

Clustering using JMS Plugin

GeoServer supports clustering using JMS cluster plugin or using the ActiveMQ-broker.

You can read more about how to set up clustering in kartoza clustering

Running the Image

Run (automated using docker-compose)

We provide a sample docker-compose.yml file that illustrates how you can establish a GeoServer + PostGIS.

If you are interested in the backups, add a section in the docker-compose.yml following instructions from docker-pg-backup.

Start the services using:

docker-compose up -d

Note The username and password are specified in the .env file. It is recommended to change them into something more secure. If you do not pass the env GEOSERVER_ADMIN_PASSWORD the container generates a random string which will be your password. This is visible from the startup logs.

Once all the services start, test by visiting the GeoServer landing page in your browser: http://localhost:8600/geoserver.

Reverse Proxy using NGINX

You can also put Nginx in front of GeoServer to receive the http request and translate it to uwsgi.

A sample docker-compose-nginx.yml is provided for running GeoServer and Nginx

docker-compose -f docker-compose-nginx.yml  up -d

Once the services are running GeoServer will be available from

http://localhost/geoserver/web/

Kubernetes (Helm Charts)

You can run the image in Kubernetes following the recipe

Contributing to the image

We welcome users who want to contribute enriching this service. We follow the git principles and all pull requests should be against the develop branch so that we can test them and when we are happy we push them to the master branch.

Upgrading GeoServer Versions

GeoServer releases and bug fixes are done frequently. We provide a helper script upgrade_geoserver_version.sh which can be run to update the respective files which mention the GeoServer version. To upgrade to a new version involves two steps:

  1. Upgrade text files stable_plugins.txt and community_plugins.txt as new versions usually have extensions promoted/demoted from community/stable extensions.
  2. Run the upgrade script that updates some env variables.

Upgrade extensions files

In the build_data directory, two helper files are provided that generate a list of extensions for stable_plugins.txt and community_plugins.txt. Before running these scripts you need to install the following Python packages

    pip3 install beautifulsoup4
    pip3 install requests

Then execute the scripts as below:

For community extensions run the command below:

    cd ./build_data
    python3 community_plugins.py 2.23.x

For stable extensions run the command below:

cd ./build_data
python3 stable_plugins.py 2.25.1 https://sourceforge.net/projects/geoserver/files/GeoServer
    

Run upgrade helper script

/bin/bash upgrade_geoserver_version.sh ${GS_VERSION} ${GS_NEW_VERSION}

Note: The script will also push these changes to the current repo, and it is up to the individual running the script to push the changes to his specific branch of choice and then complete the pull request

Support

When reporting issues especially related to installed extensions (community and stable) please refer to the GeoServer Issue page to see if there are no issues reported there. We rely on the GeoServer community to resolve upstream issues. For urgent upstream problems, you will need to get paid support from the developers in GeoServer.

Other platforms where users can ask questions and get assistance are listed below:

If you require more substantial assistance from kartoza (because our work and interaction on docker-geoserver is pro bono), please consider taking out a Support Level Agreeement

Credits

docker-geoserver's People

Contributors

alexgacon avatar alexgleith avatar alexkuretz avatar andyphenix avatar archer-v avatar arigesher avatar avvertix avatar carderm avatar celikn avatar cjauvin avatar curtis18 avatar cvagner avatar daf avatar dependabot[bot] avatar dunn avatar krisaoe avatar kumark95 avatar mawoc avatar miceg avatar nkmol avatar nyakudyaa avatar pedroetb avatar robertd avatar seifer08ms avatar srstsavage avatar stranljip avatar sumarlidason avatar tharanathkartoza avatar timlinux avatar zacharlie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-geoserver's Issues

Latest version of the docker image is throwing 404 error

My geoserver container is throwing a 404 if using the latest version (pull made on Friday 22 Nov)
I had to fix the version to 2.15.2 in order to make it work again.
image: kartoza/geoserver:latest not working
image: kartoza/geoserver:2.15.2

Regards,
Sam

Proxy

How can I set the Tomcat / Java proxy?

How to add geoserver extension?

Im trying to add geoserver plugin which is control-flow but to no avail.

i add the control-flow jar file to the /usr/local/tomcat/webapps/geoserver/WEB-INF/lib
and the controlflow.properties file to the /opt/geoserver/data_dir

below is my dockerfile

FROM kartoza/geoserver
ADD gs-control-flow-2.9.1.jar /usr/local/tomcat/webapps/geoserver/WEB-INF/lib
ADD controlflow.properties /opt/geoserver/data_dir

however it doesnt detect it.

do you know how to implement this on docker?
Your help is much appreciated..

WARN [org.geoserver] - Failed to load logging configuration file 'logging.xml'

When starting geoserver, I see this:

geoserver_1                  | 18 Jul 15:21:32 WARN [org.geoserver] - Failed to load logging configuration file 'logging.xml'
geoserver_1                  | com.thoughtworks.xstream.io.StreamException: 
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:126)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:63)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
geoserver_1                  | 	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1346)
geoserver_1                  | 	at org.geoserver.config.util.XStreamPersister.load(XStreamPersister.java:626)
geoserver_1                  | 	at org.geoserver.config.GeoServerLoader.depersist(GeoServerLoader.java:952)
geoserver_1                  | 	at org.geoserver.config.GeoServerLoader.readConfiguration(GeoServerLoader.java:816)
geoserver_1                  | 	at org.geoserver.config.DefaultGeoServerLoader.loadGeoServer(DefaultGeoServerLoader.java:65)
geoserver_1                  | 	at org.geoserver.config.GeoServerLoader.postProcessBeforeInitialization(GeoServerLoader.java:279)
geoserver_1                  | 	at org.geoserver.config.GeoServerLoaderProxy.postProcessBeforeInitialization(GeoServerLoaderProxy.java:59)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
geoserver_1                  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
geoserver_1                  | 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
geoserver_1                  | 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
geoserver_1                  | 	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
geoserver_1                  | 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
geoserver_1                  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
geoserver_1                  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
geoserver_1                  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
geoserver_1                  | 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
geoserver_1                  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
geoserver_1                  | 	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
geoserver_1                  | 	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
geoserver_1                  | 	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
geoserver_1                  | 	at org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:23)
geoserver_1                  | 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900)
geoserver_1                  | 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363)
geoserver_1                  | 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
geoserver_1                  | 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
geoserver_1                  | 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)
geoserver_1                  | 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
geoserver_1                  | 	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
geoserver_1                  | 	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1868)
geoserver_1                  | 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
geoserver_1                  | 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
geoserver_1                  | 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
geoserver_1                  | 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
geoserver_1                  | 	at java.lang.Thread.run(Thread.java:748)
geoserver_1                  | Caused by: java.io.EOFException: input contained no data
geoserver_1                  | 	at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003)
geoserver_1                  | 	at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
geoserver_1                  | 	at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
geoserver_1                  | 	at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
geoserver_1                  | 	at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
geoserver_1                  | 	at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
geoserver_1                  | 	... 54 more

Am I using the image wrongly?

GEOSERVER_ADMIN_PASSWORD has no effect

The following command results in a geoserver instance that still has the default admin password.

docker run --name "geoserver"  -e GEOSERVER_ADMIN_PASSWORD='myawesomegeoserver' -p 8080:8080 -d -t kartoza/geoserver

Storing data on the host fails with geoserver-2.15.0

Storing data on the host fails with geoserver:2.15.0, i do not know why...

$ docker run -d -v $HOME/geoserver_data:/opt/geoserver/data_dir kartoza/geoserver:2.15.0
643d6fcbab0ccb323f80125a8ac9cfbf32dfeb7112fe0a343f1c16ebd67a9da5

$ docker ps -a
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                      PORTS               NAMES
643d6fcbab0c        kartoza/geoserver:2.15.0   "/scripts/entrypointโ€ฆ"   12 seconds ago      Exited (1) 11 seconds ago                       affectionate_cray

$ docker logs affectionate_cray
cp: cannot stat '/opt/geoserver/data_dir/security/usergroup/default/users.xml': No such file or directory
/scripts/update_passwords.sh: line 25: /opt/geoserver/data_dir/security/usergroup/default/users.xml: No such file or directory
cat: /opt/geoserver/data_dir/security/usergroup/default/users.xml.orig: No such file or directory

the rights are however correctly positioned, but the geoserver_data directory remains desperately empty.

$ ls -ld ../geoserver_data
drwxrwxrwx 2 docker docker 4096 sept. 10 14:22 ../geoserver_data/

Replace geoserver:2.15.0 with georserver:latest, and everything is working properly!

$ docker run -d -v $HOME/geoserver_data:/opt/geoserver/data_dir kartoza/geoserver:latest
45ad6825c83cec95a138331c9f52b0f0a216362b30e8f701752d57fba9abd621

$ ls -l ../geoserver_data
total 40
drwxr-xr-x 2 root root 4096 sept. 10 14:30 csw/
drwxr-xr-x 3 root root 4096 sept. 10 14:30 gwc/
-rw-r--r-- 1 root root 1543 sept. 10 14:30 gwc-gs.xml
-rw-r--r-- 1 root root    0 sept. 10 14:30 logging.xml
drwxr-xr-x 2 root root 4096 sept. 10 14:30 monitoring/
drwxr-xr-x 2 root root 4096 sept. 10 14:30 printing/
drwxr-xr-x 8 root root 4096 sept. 10 14:30 security/
drwxr-xr-x 2 root root 4096 sept. 10 14:30 styles/
drwxr-xr-x 3 root root 4096 sept. 10 14:30 temp/
drwxr-xr-x 2 root root 4096 sept. 10 14:30 tmp/
-rw-r--r-- 1 root root 1743 sept. 10 14:30 wps.xml

no problems either with previous versions of geoserver : 2.12.0, 2.12.1, 2.13.0.
nb : I emptied the geoserver_data directory between each trial.

latest version of geoserver is 2.15.2.

thanks in advance for any help.

Oracle JDK changed it's licence

Problem

Oracle changed it's licence a couple of months back and ever since our builds are partially working because of this restrictions. The setup scripts download a bunch of these.

Screenshot 2019-07-10 at 17 52 39

Solution

  • Please investigate a feasible solution.
  • We could fetch them from other third-party repos.
  • Update the licence terms to reflect the new Oracle changes

cc @gubuntu @timlinux

docker-compose geoserver unhealthy

test: curl --fail -s http://localhost:8080/ || exit 1

(I'm currently running several commits behind @ dc583de )

When I use a docker-compose instance the geoserver container seems to be persistently unhealthy when I look at the status from docker ps.

I had a look at the health check in the docker-compose.yml.
Geoserver container 8080 is exposed on my host machine as 8600.
I tried the following manually.

$ curl --fail -s http://localhost:8600/ || echo FAILED 
> FAILED
$ curl --head http://localhost:8600 
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Transfer-Encoding: chunked
Date: Wed, 15 Jan 2020 05:17:54 GMT
$ curl --head http://localhost:8600/geoserver
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
X-Frame-Options: SAMEORIGIN
Location: /geoserver/index.html
Transfer-Encoding: chunked
Date: Wed, 15 Jan 2020 05:18:08 GMT
$ curl --fail -s http://localhost:8600/geoserver || echo FAILED

So I'm wondering if
curl --fail -s http://localhost:8080/geoserver || exit 1
might work better for the health check?
Seems to be working for me but haven't left it running for long.

Cleanup branches

Problem

We have many branches in this repo. I think we should delete some of the old branches and remain with a few ie

  • 2.12
  • 2.13
  • 2.15
  • develop
  • master

The rest should be deleted.

cc @gubuntu @timlinux

SSL / HTTPS

I was able to get a container up and running no problem using the instructions you've provided. However, I ideally want Geoserver being served over HTTPS, which I have set up on the host.
Do you have any idea how to enable this on the container? Is it a Tomcat issue?
Here's the error I receive when I try to access it over HTTPS:

An error occurred during a connection to data.nrri.umn.edu:32770. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

Might be something to do with the port that's being used??
Thanks for any assistance you can provide.

Plugin Installation not working?

I changed the GS_Version within the Dockerfile to:
ENV GS_VERSION 2.12.1

I downloaded one of the plugin files to:
docker-geoserver/resources/plugins/geoserver-2.12.1-vectortiles-plugin.zip

Also downloaded:
docker-geoserver/resources/geoserver.zip

Then built:
docker build --build-arg TOMCAT_EXTRAS=false -t kartoza/geoserver .

And then started the GeoServer. It became version 2.12.1 but my pluging is not installed.

Can' t login into geoserver

Steps to replicate:

git clone https://github.com/kartoza/docker-geoserver
cd docker-geoserver
git show
commit 868d89a (HEAD -> master, origin/master, origin/HEAD)
docker build --build-arg INITIAL_MEMORY=750M --build-arg MAXIMUM_MEMORY=1G -t kartoza/geoserver .
docker run --name "geoserver" -e GEOSERVER_ADMIN_PASSWORD='myawesomegeoserver' -p 8080:8080 -d -t kartoza/geoserver

The login with any password give the following error (see below). Seems there is some problems with the password creation maybe how is it done on script scripts/update_password.sh

org.jasypt.exceptions.EncryptionOperationNotPossibleException org.jasypt.digest.StandardByteDigester.matches(StandardByteDigester.java:1107) org.jasypt.digest.StandardStringDigester.matches(StandardStringDigester.java:1052) org.jasypt.util.password.StrongPasswordEncryptor.checkPassword(StrongPasswordEncryptor.java:99) org.jasypt.spring.security3.PasswordEncoder.isPasswordValid(PasswordEncoder.java:204) org.geoserver.security.password.AbstractGeoserverPasswordEncoder.isPasswordValid(AbstractGeoserverPasswordEncoder.java:142) org.geoserver.security.password.GeoServerMultiplexingPasswordEncoder.isPasswordValid(GeoServerMultiplexingPasswordEncoder.java:91) org.springframework.security.authentication.dao.DaoAuthenticationProvider.additionalAuthenticationChecks(DaoAuthenticationProvider.java:94) org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:165) org.geoserver.security.auth.UsernamePasswordAuthenticationProvider.authenticate(UsernamePasswordAuthenticationProvider.java:82) org.geoserver.security.GeoServerAuthenticationProvider.authenticate(GeoServerAuthenticationProvider.java:58) org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:167) org.geoserver.security.GeoServerSecurityManager$1.authenticate(GeoServerSecurityManager.java:323) org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:93) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:116) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53) org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88) org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89) org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42) org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48) org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Failed to install plugins

It seems like some of the plugins fail to install after running

git clone https://github.com/kartoza/docker-geoserver.git
cd docker-geoserver
docker build -t <tag> .

The issue seems to be that wget (inside scripts/setup.sh) fails on some of them with Issued certificate has expired. so adding the --no-check-certificate flag solves the problem for us.

How to clone the docker with an existing data?

First, really appreciate this masterpiece. I am able to up a geoserver in less than 5 minutes (compared to few hours if i didn't use docker)

Now, I am able to use docker volume to create a store inside the geoserver, with the data files from my host. It works brilliant.

Next, I have a question. Assuming I have created a store (eg: a vector data shapefile is added), how do I share/clone this entire thing to my colleagues, such that he/she need not setup an empty geoserver again, but could immediately have all i have at the latest state?

Exception on starting

Getting this exception in latest version
Digest:sha256:df010edd6d24fff012fd10254036d94057c5e9357f379c86f84215c504568062

docker run kartoza/geoserver

SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/geoserver]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1868)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/geoserver] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.sqlite.SQLiteConnection->org.sqlite.jdbc4.JDBC4Connection->org.sqlite.jdbc3.JDBC3Connection->org.sqlite.SQLiteConnection]
        at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2098)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2044)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1989)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1959)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1913)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1156)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:773)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        ... 10 more

12-Sep-2019 09:51:05.516 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory /usr/local/tomcat/webapps/geoserver
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/geoserver]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1868)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

In the previous version (2.15.2) everything is OK

Issue Enabling CORS

I need CORS enabled so I can get WMS layers from geoserver with Cesium. When running my own version of geoserver(not dockerized) I just edit /tomcat/webapps/geoserver/WEB-INF/web.xml and uncomment the CORS filters. I copied the web.xml file, edited it, and then ran docker with the new web.xml mounted by doing: docker run --name "geoserver" --link postgis:postgis -v ~/web.xml:/usr/local/tomcat/webapps/geoserver/WEB-INF/web.xml -p 8080:8080 -d -t kartoza/geoserver

After making this change when I got to localhost:8080/geoserver/index.html I get a 404 error. Any idea why this is happening or know of a way to enable CORS?

EDIT: Please close this issue, I realized I was editing the wrong the web.xml file. For anyone having this issue, you have to edit the /tomcat/conf/web.xml (not /tomcat/webapps/geoserver/WEB-INF/web.xml) file and in the filter section add this:

CorsFilter org.apache.catalina.filters.CorsFilter CorsFilter /*

Geoserver 2.17.x

Any support for it? They included SAMLv2 for authentication.

Regards,

Building new docker image fails

The problem:

Trying to build a docker image using:
docker build --build-arg ORACLE_JDK=true -t kartoza/geoserver .
fails.

Reason:

In the current Dockerfile, lines 41-67 contain 3 install steps. These install steps execute a wget that saves a archive to ./resources, though the dpkg install step tries to execute it from /tmp/resources.
RUN if [ ! -f /tmp/resources/libjpeg-turbo-official_1.5.3_amd64.deb ]; then \ wget https://tenet.dl.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-official_1.5.3_amd64.deb -P /tmp/resources;\ fi; \ cd /tmp/resources/ && \ dpkg -i libjpeg-turbo-official_1.5.3_amd64.deb

Computer configuration

Dell E5570
Windows 10 x64
Docker engine 18.03.0-ce (linux containers)

Solution

I can create a PR to update if someone else can also reproduce this.

How to build with CORS support?

@NyakudyaA in #24 and #60, you mentioned that your 2.15.2 image includes CORS support. But how is that image built (in case I wanted to build a slightly modified version)? Surely not just plain with build.sh? Do you just need to include the web.xml in the resources/overlays folder when building?

Missing PostGis Datasource Entry

if i deploy this geoserver to our kubernetes cluster the postgres Entry on Datasource is missing. But the extension is included.
image

If i run the docker build locally it is still there.

Does someone know why this happens?

Plugins in setup.sh not installed

I noticed that the image does not include the plugins which should be installed by setup.sh. I solved the issue by creating the plugins tmp folder with this

if [ ! -d ${work_dir}/plugins ];
 then
     echo "Creating tmp plugins directory"
     mkdir -p ${work_dir}/plugins
 else
     echo "tmp plugins directory already exist"
 fi

before this

pushd ${work_dir}/plugins

overlays not working when building dockers based on this docker-image

We like to enable CORS on geoserver, as per #24, and store this configuration in our own git repo so we can deploy this on various servers. The way we envisioned this, was to create a docker-compose.yml with the relevant dockers and have directories per docker image with extra settings:

version: '2'
services:
  postgres:
    build: ./docker/postgres/
    container_name: postgres
    ports:
          - 5432:5432
    environment:
          - POSTGRES_DB=db
          - POSTGRES_USER=user
          - POSTGRES_PASSWORD=pass
          - PG_DATA_DIR=./docker/postgres/data
    volumes:
          - ${PG_DATA_DIR}:${PGDATA}
  geoserver:
      build: ./docker/geoserver/
      container_name: geoserver
      volumes:
          - ${EXT_GEOSERVER_DATA_DIR}:/opt/geoserver/data_dir
      env_file: .env
      ports:
          - 8080:8080
      depends_on:
          - postgres
      expose:
          - 8080

in the docker/geoserver directory we have a Dockerfile, a data directory and a resources directory

The Dockerfile just states:

FROM kartoza/geoserver

In the resources directory we've added the web.xml with the CORS headers enabled:

14:19 $ tree resources/
resources/
โ””โ”€โ”€ overlays
    โ””โ”€โ”€ usr
        โ””โ”€โ”€ local
            โ””โ”€โ”€ tomcat
                โ””โ”€โ”€ conf
                    โ””โ”€โ”€ web.xml

Our believe was that by the geoserver docker would take the content of the resources/overlay directory and overlay this in the docker image when building it. However the resources directory is being ignored. Diving into the kartoza/docker-geoserver repo I realized it was never going to work, the resources directory is not mounted but added in the build step. Furthermore the contents of the resources directory will be removed in the final step of (setup.sh)[https://github.com/kartoza/docker-geoserver/blob/master/scripts/setup.sh#L227] so even when the mount would work, it will destroy the configuration on disk.

We considered embedding the docker-geoserver repo into our repo and add the necessary configuration files to ./resources but due to the .gitignore the settings will not be persistent.

So my question is, how do you envision to add your own resources to a docker image based on the kartoza/docker-geoserver image?

And yes I'm aware of #23 but that was the datadirectory which shouldn't be done with resources in the first place and also I'm not sure it was really resolved for him/her.

Missing PostGIS store?

I installed the kartoza/geoserver:2.15.2 version, and really like how many vector and raster data sources are available out of the box when I try to create a new Store.

One extremely important seems to be missing though: PostGIS. This should be included in any GeoServer by default, how can it be, that I cannot see it, and therefore cannot add a PostGIS Store to my GeoServer?

Or did I do something wrong? My Dockerfile consists of nothing else than simply:
"FROM kartoza/geoserver:2.15.2"

See:
image

setup.sh run every rebuild - requires internet access

setup.sh is run on every rebuild and requires internet access. This is not always desired if making a secure install of Geoserver behind a firewall. When internet access is not available geoserver will not start

ImageMosaicJDBC error on Publishing

Hi, after installing the kartoza/geoserver:2.13.0 docker container and installing de ImageMosaicJDBC pluging, I made it to create the Store from a raster in postgis, but on the next screen after clicking on the Publish button an exception arises:

C_centralis raster and xml.zip

org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener targeted at org.apache.wicket.ajax.markup.html.AjaxLink$1@791b1776 on component [AjaxLink [Component id = link]] threw an exception at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:157) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75) at org.geogig.geoserver.spring.config.GeogigMultipartFilter.doFilterInternal(GeogigMultipartFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.flow.controller.IpBlacklistFilter.doFilter(IpBlacklistFilter.java:94) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.flow.ControlFlowCallback.doFilter(ControlFlowCallback.java:245) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:157) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53) at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2527) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2516) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258) ... 120 more Caused by: java.lang.RuntimeException: Error occurred while building the resources for the configuration page at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:411) at org.geoserver.web.data.layer.NewLayerPage$9.onClick(NewLayerPage.java:301) at org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:47) at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:85) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:155) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:601) ... 125 more Caused by: java.lang.ArithmeticException: / by zero at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.decimationOnReadingControl(AbstractGridCoverage2DReader.java:659) at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.setReadParams(AbstractGridCoverage2DReader.java:409) at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.setReadParams(AbstractGridCoverage2DReader.java:320) at org.geotools.gce.imagemosaic.jdbc.ImageMosaicJDBCReader.loadTiles(ImageMosaicJDBCReader.java:439) at org.geotools.gce.imagemosaic.jdbc.ImageMosaicJDBCReader.read(ImageMosaicJDBCReader.java:316) at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.read(AbstractGridCoverage2DReader.java:261) at org.geoserver.catalog.CoverageDimensionCustomizerReader.read(CoverageDimensionCustomizerReader.java:232) at org.geoserver.catalog.SingleGridCoverage2DReader.read(SingleGridCoverage2DReader.java:145) at org.geoserver.catalog.CatalogBuilder.getCoverageSampleDimensions(CatalogBuilder.java:1180) at org.geoserver.catalog.CatalogBuilder.buildCoverageInternal(CatalogBuilder.java:1070) at org.geoserver.catalog.CatalogBuilder.buildCoverage(CatalogBuilder.java:1001) at org.geoserver.catalog.CatalogBuilder.buildCoverage(CatalogBuilder.java:961) at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:398) ... 130

Upgrade to GeoServer 2.9.x

GeoServer 2.9.x has been stable for a while now:

http://geoserver.org/release/stable/

GeoServer 2.9 appears to require Java 8:

http://docs.geoserver.org/stable/en/user/production/java.html

This will require a few small changes in the Dockerfile, including a change to use FROM tomcat:8-jre8.

Also, the current master state (Geoserver 2.8.2) should become a build on Docker Hub. I don't see any tags in the GitHub repo currently so I'm not sure how those are set up. Ideally I think Docker Hub should build all tags as images, and each GeoServer version should be tagged in the repo.

Once the release/tag pattern is clarified I can make a PR to upgrade to GeoServer 2.9.x.

REST Api

Hello,

I am using GeoServer version 2.15 and I am having issues with the endpoints, some of them work some doesn't.

When I hit the endpoint to create a new user (http://localhost:8093/geoserver/rest/security/usergroup/users), I get this error in the browser:
Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter

Are there any missing .jar files in this image?

and here is the stack of errors from the log file:

2019-12-05 15:58:01,755 ERROR [geoserver.rest] - Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1053)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:26)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:69)
    at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:73)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
    at org.geoserver.flow.controller.IpBlacklistFilter.doFilter(IpBlacklistFilter.java:89)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
    at org.geoserver.monitor.MonitorFilter.doFilter(MonitorFilter.java:137)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
    at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:37)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:51)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:142)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:90)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:79)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2464)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter
    at com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator.<init>(ToXmlGenerator.java:179)
    at com.fasterxml.jackson.dataformat.xml.XmlFactory.createGenerator(XmlFactory.java:455)
    at com.fasterxml.jackson.dataformat.xml.XmlFactory.createGenerator(XmlFactory.java:29)
    at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:255)
    at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:103)
    at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:289)
    at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:180)
    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:82)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:119)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
    ... 95 more
2019-12-05 15:58:01,758 WARN [annotation.ExceptionHandlerExceptionResolver] - Resolved [org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter]

Cheers

Tomcat version is out of date

The tomcat version the image is built on is pretty old (tomcat 7/jre-8). build options should be included to set those at build time.

sslmode setting

I am curious on how to enable sslmode for my postgis datastore connections. Thanks!

Using Tomcat base container but running self-contained Geoserver bin?

I'm confused as to why you're starting with the Tomcat 8.0 base container but are opting to instead run the self-contained Geoserver binary which runs on Jetty 6.1.8.

My use case is to run this container as part of an integration test and connect the container to a database container and I'd like to use JNDI to do so, but obviously writing the JNDI connection info into /usr/local/tomcat/conf/context.xml doesn't work and downloading the postgres driver to /usr/local/tomcat/lib isn't going to work.

Why not just run the Geoserver war on the Tomcat container?

Database connections unclear

It is unclear to us, how in docker-compose.yml, geoserver is made aware of the postgis database. For geogig, I can see that PGHOST=geogig-db is provided in geogig.env, but I am missing a similar configuration option for geoserver. How does this work? What is the default configuration and where is it set? Especially: How can I point geoserver at another database?

And finally: How does backup of all databases work? Do I need to setup a dbbackups container for each database? Currently docker-compose.yml seems to only provide backups for geoserver's database, but not for geogig's database.

cp: cannot stat issue

when i exec the command like this;

docker run -it --name "geoserver" -v "D:/docker/data/geoserver_data:/opt/geoserver/data_dir" -e GEOSERVER_ADMIN_PASSWORD='myawesomegeoserver' -p 8080:8080 kartoza/geoserver

cp: cannot stat '/opt/geoserver/data_dir/security/usergroup/default/users.xml': No such file or directory
/scripts/update_passwords.sh: line 25: /opt/geoserver/data_dir/security/usergroup/default/users.xml: No such file or directory
cat: /opt/geoserver/data_dir/security/usergroup/default/users.xml.orig: No such file or directory

Mounting data_dir volume loses data

The README suggests using docker run -d -v $HOME/geoserver_data:/opt/geoserver/data_dir kartoza/geserver in order to mount GeoServer's data in a volume. Have you actually tested this? Because it doesn't work for me.

If you specify -v host/path:container/path instead of just -v container/path, Docker will not copy the contents of container/path into the volume to avoid overwriting any files already in host/path. Hence, when trying to mount data_dir to a specific host directory, Docker doesn't actually copy the contents of data_dir in the image into the volume, and hence all existing configuration is lost. In particular, data_dir/security/usergroup/default/config.xml is missing, which causes GeoServer startup to fail.

Is there a solution to this? A workaround would be to manually copy the contents of data_dir out of the image into the host filesystem, then mount that copied directory back into the container so the container is given everything it should have. This isn't very nice to automate though.

Alternatively another geoserver container could be run to store the data, then its data_dir mounted with --volumes-from?

Azure Docker container instance compatibility

Hi, I have just tested to host this on the Azure Docker container instance.
However, it seems that it is not working (unable to reach the site)... Anything that i missed out?

*Note, everything works perfectly in my Windows 10 Pro.

Implement CORS on tomcat

The image doesn't implement CORS and this is required for webgis developments

Tryied to implement CORS on
/usr/local/tomcat/conf/web.xml

By adding the following configuration:

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
  </init-param>

  <init-param>
    <param-name>cors.exposed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
  <init-param>
    <param-name>cors.preflight.maxage</param-name>
    <param-value>10</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

But still there was problems with CORS not being suported on Chrome (Linux) v71

Some explanation has been found here:
https://stackoverflow.com/a/24390640/1140558
https://stackoverflow.com/a/39733875/1140558

Seems that setting Origin on a request it works and gets the proper headers back:
curl -I -H 'Origin: http://www.example.com' http://localhost:8080/geoserver

overlays not working?

I am using docker-compose to combine docker-geoserver with some other containers.
In my docker-compose.yml i am pointing at my Dockerfile which basically just contains a
FROM kartoza/docker-geoserver. Next to the Dockerfile i created a folder structure like: resources/overlays/opt/geoserver/data_dir/workspaces/and_so_forth. When using docker-compose build i expected to see that folders and files mirrored in my mapped data_dir volume. But nothing happens. When i exec /bin/bash into the geoserver container no extra folders can be found below /opt/geoserver/data_dir.
Do you have any suggestions why this fails?

The relevant part of my docker-compose.yml file looks like this:

  my-geoserver:
    build: my-geoserver/
    ports:
      - "8080:8080"
    volumes:
      - ./my-geoserver/data_dir:/opt/geoserver/data_dir
    links:
      - my-postgis
    restart: always

configuring ssl with letsencrypt

Need some guidance on how to setup SSL with this container; I'm familiar with configuring SSL, but not as it relates to Docker. Thanks!

License file

The licensing terms of this project are not clear. Could you upload a license file to the repository?

Need old master password in order to change to a new one

I'm using your geoserver docker image and I can't figure out what the master password is. It appears to be encrypted in file opt/geoserver/data_dir/security/masterpw/default/passwd.

In order to change the master password on my installation I need the old one.

Can you help me out?

Release 2.16 on docker hub

Geoserver 2.16 has been committed in (afb2b8d), but is not yet available on docker hub. Can you make a release so we can download the latest version from docker hub?
I see latest points to 2.16, but I'd like to stick to a specific version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.