Docker container for GeoServer on top of Apache Tomcat, using the Web Archive distribution package.
For docker images already built, check DockerHub' chbrandt/geoserver.
Container settings:
- Exposed port is
8080
(Tomcat's default) - Credentials are the default ones:
- username:
admin
- password:
geoserver
- username:
- Geoserver data directory is:
GEOSERVER_DATA_DIR='/var/lib/geoserver_data'
Run the (latest
) container:
$ docker run -p 8080:8080 chbrandt/geoserver
Give it a data directory to copy/publish:
$ docker run -v $PWD/data:/data \
-p 8080:8080 chbrandt/geoserver
Then go to your browser' http://localhost:8080/geoserver.
If you want to create an image for a particular version of GeoServer you can
give docker build
an argument specifying it:
$ cd dockerfile/
$ docker build --build-arg GEOSERVER_VERSION=2.18.3 -t my_geoserver .
By default, the data is stored under data/
in the root of GeoServer installation,
in a Tomcat/WAR setup it is at ${CATALINA_HOME}/webapps/geoserver/data/
.
To change it one can define an environment variable 'GEOSERVER_DATA_DIR
'
defining the path to use instead. E.g.,
$ docker run -e GEOSERVER_DATA_DIR='/var/lib/geoserver_data' \
-p 8080:8080 chbrandt/geoserver
See GeoServer' docs on data-directory