From 8fb15fe212fa115fcf1630195e764b890b3d0372 Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Fri, 16 Dec 2022 14:53:48 +0100 Subject: [PATCH] Formatting of README --- README.md | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c8b1ad5..2f1be04 100644 --- a/README.md +++ b/README.md @@ -17,23 +17,23 @@ This Dockerfile can be used to create images for all geoserver versions since 2. To pull an official image use ``docker.osgeo.org/geoserver:{{VERSION}}``, e.g.: -``` +```shell docker pull docker.osgeo.org/geoserver:2.21.1 ``` Afterwards you can run the pulled image locally with: -``` +```shell docker run -it -p 80:8080 docker.osgeo.org/geoserver:2.21.1 ``` Or if you want to start the container daemonized, use e.g.: -``` +```shell docker run -d -p 80:8080 docker.osgeo.org/geoserver:2.21.1 ``` -Check http://localhost/geoserver to see the geoserver page, +Check to see the geoserver page, and login with geoserver default `admin:geoserver` credentials. **IMPORTANT NOTE:** Please change the default ``geoserver`` and ``master`` passwords. @@ -44,8 +44,7 @@ For more information see the user-guide [docker installation instructions](https To use an external folder as your geoserver data directory. - -``` +```shell docker run -it -p 80:8080 \ --mount src="/absolute/path/on/host",target=/opt/geoserver_data/,type=bind \ docker.osgeo.org/geoserver:2.21.1 @@ -60,7 +59,7 @@ This image populates ``/opt/geoserver_data/`` with demo data by default. For pro The environment variable `SKIP_DEMO_DATA` can be set to `true` to create an empty data directory. -``` +```shell docker run -it -p 80:8080 \ --env SKIP_DEMO_DATA=true \ docker.osgeo.org/geoserver:2.21.1 @@ -81,7 +80,7 @@ The ``startup.sh`` script allows some customization on startup: Example installing wps and ysld extensions: -``` +```shell docker run -it -p 80:8080 \ --env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS="wps,ysld" \ docker.osgeo.org/geoserver:2.21.1 @@ -89,7 +88,7 @@ docker run -it -p 80:8080 \ The list of extensions (taken from SourceForge download page): -``` +```shell app-schema gdal jp2k ogr-wps web-resource authkey geofence libjpeg-turbo oracle wmts-multi-dimensional cas geofence-server mapml params-extractor wps-cluster-hazelcast @@ -106,7 +105,7 @@ excel inspire ogr-wfs wcs2_0-eo If you want to add geoserver extensions/libs, place the respective jar files in a directory and mount it like -``` +```shell docker run -it -p 80:8080 \ --mount src="/dir/with/libs/on/host",target=/opt/additional_libs,type=bind \ docker.osgeo.org/geoserver:2.21.1 @@ -116,7 +115,7 @@ docker run -it -p 80:8080 \ If you want to add custom fonts (the base image only contains 26 fonts) by using a mount: -``` +```shell docker run -it -p 80:8080 \ --mount src="/dir/with/fonts/on/host",target=/opt/additional_fonts,type=bind \ docker.osgeo.org/geoserver:2.21.1 @@ -130,7 +129,7 @@ docker run -it -p 80:8080 \ To watch ``geoserver.log`` of a running container: -``` +```shell docker exec -it {CONTAINER_ID} tail -f /opt/geoserver_data/logs/geoserver.log ``` @@ -142,16 +141,15 @@ Stage geoserver data directory contents into ``geoserver_data``, and any extensi Run ``docker-compose``: -``` +```shell docker-compose -f docker-compose-demo.yml up --build ``` ## How to Build? - ### How to build a local image? -``` +```shell docker build -t {YOUR_TAG} . ``` @@ -159,13 +157,13 @@ docker build -t {YOUR_TAG} . After building run using local tag: -``` +```shell docker run -it -p 80:8080 {YOUR_TAG} ``` ### How to build a specific GeoServer version? -``` +```shell docker build \ --build-arg GS_VERSION={YOUR_VERSION} \ -t {YOUR_TAG} . @@ -173,7 +171,7 @@ docker build \ ### How to build with custom geoserver data directory? -``` +```shell docker build \ --build-arg GS_DATA_PATH={RELATIVE_PATH_TO_YOUR_GS_DATA} \ -t {YOUR_TAG} . @@ -185,7 +183,7 @@ docker build \ Yes! Just pass the `--build-arg` param twice, e.g. -``` +```shell docker build \ --build-arg GS_VERSION={VERSION} \ --build-arg GS_DATA_PATH={PATH} \ @@ -198,7 +196,7 @@ Put your `*.jar` files (e.g. the WPS extension) in the `additional_libs` folder **Note:** Similar to the GeoServer data path from above, you can also configure the path to the additional libraries by passing the `ADDITIONAL_LIBS_PATH` argument when building: -``` +```shell docker build \ --build-arg ADDITIONAL_LIBS_PATH={RELATIVE_PATH_TO_YOUR_LIBS} -t {YOUR_TAG} . @@ -211,16 +209,19 @@ docker build \ OSGeo maintains geoserver-docker.osgeo.org repository for publishing. The results are combined into docker.osgeo.org repository alongside other software such as PostGIS. Build locally: -``` + +```shell docker build -t geoserver-docker.osgeo.org/geoserver:2.21.1 . ``` Login using with osgeo user id: -``` + +```shell docker login geoserver-docker.osgeo.org ``` Push to osgeo repository: -``` + +```shell docker push geoserver-docker.osgeo.org/geoserver:2.21.1 ```