SELF-LINK: https://github.com/lat-lon/deegree-workshop/blob/nintyMinutesQuickTutorial/README.md
Link to all slides at the end of the document!
7 minute tutorial how to install Docker Community Edition (CE)
On Ubuntu:
sudo apt-get install docker-engine
sudo service docker start
docker run hello-world
Attention: On LINUX the docker daemon binds on a UNIX socket which is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user.
Docker Hub: https://hub.docker.com/r/mdillon/postgis/
To download the docker image from the docker registry hub.docker.com run:
docker pull mdillon/postgis
In case no Internet connection is available you can import a Docker image from a tar archive:
docker load -i <PATH_TO_USB_DRIVE>/Docker/postgis.tar
To run the Docker container execute:
docker run -d --name postgis -p 5432:5432 mdillon/postgis
Hint: You can find an overview of basic Docker commands at the end of this tutorial under Overview of basic docker commands.
Docker Hub: https://hub.docker.com/r/fenglc/pgadmin4/
docker pull fenglc/pgadmin4
docker run -d --name pgadmin4 -p 5050:5050 --link postgis:postgres fenglc/pgadmin4
Open in browser: http://localhost:5050/browser/
Use the following credential to login:
User: pgadmin4@pgadmin.org
Password: admin
Hint: On Windows and macOS when running Docker with Docker Toolbox (using VirtualBox) you have to use the IP of the Docker Machine, such as 192.168.99.100 as the container IP instead of localhost!
Hostname: postgres
Port: 5432
User: postgres
Add a technical user for deegree with password ‘deegree’:
CREATE ROLE deegree LOGIN
ENCRYPTED PASSWORD 'md5b73ce574b23cf58ac77c8ca9ea0d2b5f'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
COMMENT ON ROLE deegree IS 'technical user for deegree FeatureStore config';
Hint: Use persistent data volume container for productive systems, otherwise you may lose your data when removing the container!
Docker Hub: https://hub.docker.com/r/deegree/deegree3-docker/
Dockerfile: https://github.com/deegree/deegree3-docker
docker pull deegree/deegree3-docker
docker run --name deegree -p 8080:8080 deegree/deegree3-docker
In case the container starts successfully stop it with docker stop deegree
or CTRL+c
and remove the container with docker rm deegree
.
Now link the deegree container with the postgis container and ro run the container attached to the deegree log execute the command:
docker run --name deegree -p 8080:8080 --link postgis:db deegree/deegree3-docker
Open in browser: http://localhost:8080/deegree-webservices
Navigate to "connections > databases" and create a new connection of type “DataSource” with config template “PostgreSQL (minimal)”.
Change the JDBC URL to jdbc:postgresql://db:5432/postgres
using the link name of the docker container running the PostgreSQL/PostGIS database.
Complete configuration file (saved inside the container in directory /root/.deegree/
):
<DataSourceConnectionProvider configVersion="3.4.0"
xmlns="http://www.deegree.org/connectionprovider/datasource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.deegree.org/connectionprovider/datasource http://schemas.deegree.org/jdbc/datasource/3.4.0/datasource.xsd">
<!-- Creation / lookup of javax.sql.DataSource instance -->
<DataSource javaClass="org.apache.commons.dbcp.BasicDataSource" />
<!-- Configuration of DataSource properties -->
<Property name="driverClassName" value="org.postgresql.Driver" />
<Property name="url" value="jdbc:postgresql://db:5432/postgres" />
<Property name="username" value="deegree" />
<Property name="password" value="deegree" />
<Property name="poolPreparedStatements" value="true" />
<Property name="maxActive" value="10" />
<Property name="maxIdle" value="10" />
</DataSourceConnectionProvider>
After you have successfully tested the database connection you can stop the docker container with CTRL+c
.
-
docker logs -f deegree
- follow the deegree console output -
docker attach deegree
- attach to the deegree container- You can detach from the container and leave it running with
CTRL-p CTRL-q
. Requires to pass-it
option to the docker run command! - You can stop the container with
CTRL+c
.
- You can detach from the container and leave it running with
-
docker exec -it deegree '/bin/bash'
- opens a shell in the running deegree container.- Use command
exit
to disconnect from the container.
- Use command
-
docker stats deegree
- This will present the CPU utilization for the container, the memory used and total memory available to the container. -
docker network inspect bridge
- lists the IP for each container.
Download one of the deegree workspace bundle for INSPIRE data themes
-
Protected Sites: deegree3-workspace-ps
-
Cadastral Parcels: deegree3-workspace-cp
Create a new directory .deegree
in the user home directory and copy all files into the ~/.deegree
directory.
Stop and delete the docker container deegree before you continue with:
docker stop deegree
docker rm deegree
Start now a new container with mounted user home directory ~/.deegree
:
docker run -d --name deegree -v ~/.deegree:/root/.deegree -p 8080:8080 --link postgis:db deegree/deegree3-docker
Open the deegree services console: http://localhost:8080/deegree-webservices
To configure a INSPIRE direct-access download service based on deegree WFS 2.0 serving harmonized data the following steps are needed:
-
Create the database and schema
-
Add the GML application schema to the deegree workspace
-
Create the database connection configuration file
-
Create the SQLFeatureStore configuration file
-
Create the WFS service configuration file
Each workspace bundle (deegree3-workspace-cp.zip and deegree3-workspace-ps.zip) contains the following resources:
Directory | Content | Documentation |
---|---|---|
/ddl |
SQL DDL scripts for canonical and blob mapping | PostgreSQL, PostGIS |
/scripts |
Shell scripts to execute all SQL scripts using psql CLI (Linux/Unix only) | |
/test |
SoapUI project for testing | Getting started with SoapUI |
/workspace-cp |
Complete deegree workspace with WFS and WMS configuration for INSPIRE Annex 1 data theme Cadastral Parcels including a configuration set for BLOB and canonical mapping | Configuration basics with deegree |
/workspace-ps |
Complete deegree workspace with WFS and WMS configuration for INSPIRE Annex 1 data theme Protected Sites including a configuration set for BLOB and canonical mapping | Configuration basics with deegree |
Database schema and deegree SQLFeatureStore configuration derived from GML application schema using relational/canonical mode
To derive the SQL DDL script and the deegree SQLFeatureStore configuration file from the GML application schema you can use the deegree CLI utility tool (see Supporting tools for more information).
The deegree workspace bundle contains all required files. Follow the step-by-step description to setup the deegree WFS:
-
Create the database
-
As user postgres -
~/.deegree/ddl/ps-canonical/02_create_ps_canonical_db.sql
-
As user deegree connected to ps_canonical database -
~/.deegree/ddl/ps-canonical/04_create_ps_canonical_schema.sql
-
-
Add the GML application schema to workspace (source of XSD)
~/.deegree/workspace-ps/appschemas/ProtectedSites.xsd
-
Create the database connection configuration file
~/.deegree/workspace-ps/jdbc/postgresDS_canonical.xml
-
Create the SQLFeatureStore configuration file using the deegree GMLTools CLI:
~/.deegree/workspace-ps/datasources/feature/ps_canonical.xml
-
Create the WFS service configuration file
~/.deegree/workspace-ps/services/wfs_ps_canonical.xml
-
Reload the workspace to activate the changes!
Attention: As of deegree Version 3.4 the FeatureStore wizard is not fully functional. More information how to generate the mapping and SQL DDL files read further in paragraph Supporting tools.
WFS Endpoint: http://localhost:8080/deegree-webservices/services/wfs_ps_canonical
WFS Capabilities:
Database schema and deegree SQLFeatureStore configuration based on BLOB-mode GML application mapping
-
Create the database
-
As user postgres -
~/.deegree/ddl/ps-blob/create_ps_blob_db.sql
-
As user deegree connected to ps_blob database -
~/.deegree/ddl/ps-blob/create_ps_blob_schema.sql
-
-
GML application schema should be present already
~/.deegree/workspace-ps/appschemas/ProtectedSites.xsd
-
Create the database connection configuration file
~/.deegree/workspace-ps/jdbc/postgresDS_blob.xml
-
Create the SQLFeatureStore configuration file
~/.deegree/workspace-ps/datasources/feature/ps_blob.xml
-
Create the WFS service configuration file
~/.deegree/workspace-ps/services/wfs_ps_blob.xml
-
Reload the workspace to activate the changes!
WFS Endpoint: http://localhost:8080/deegree-webservices/services/wfs_ps_blob
WFS Capabilities:
http://localhost:8080/deegree-webservices/services/wfs_ps_blob?service=WFS&request=GetCapabilities
Tools to create the SQL DDL and the deegree SQLFeatureStore configuration files:
-
deegree services console - http://localhost:8080/deegree-webservices/
- in 3.4-RC7 and later the wizard is broken (see issue #471 and related issues)
Dockerfile: -
Hint: Download SoapUI here: https://www.soapui.org/downloads/soapui.html, and unzip the package. Then start SoapUI using the start scripts or the links created by the installer. For a short intro use the Getting Starting Guide.
Open the file deegree3-workspace-ps/test/wfs200-soapui-project.xml
with SoapUI and select the project root node.
Switch to "Custom Properties" tab and set for property “wfsEndpoint”:
-
To import data into the SQLFeatureStore in BLOB modus use: http://deegree:8080/deegree-webservices/services/wfs_ps_blob
-
The WFS configured with the SQLFeatureStore in relational/canonical modus use: http://deegree:8080/deegree-webservices/services/wfs_ps_canonical
To send a WFS-T Insert action submit the test step "INSPIRE ProtectedSite > Transaction > INSERT-POST-FeatureCollection":
Switch the "wfsEndpoint" property to the other endpoint and re-submit the WFS-T Insert request to insert the data also in the other database.
-
Download and install HALE http://www.esdi-community.eu/projects/hale
-
Download and unzip http://grillmayer.eu/wp-content/uploads/2014/12/Protected_Sites_DS_Version_4_Example-1.zip
-
Import project "Protected_Sites_DS_Version_4_Example.hale" into HALE workbench
-
Start the "Export transformed data" function and select “WFS-T” as destination using one of the WFS endpoints configured.
Attention: Importing large GML files may require more hardware resources. Please check github issue #743 for further information.
Docker hub: https://hub.docker.com/r/kartoza/qgis-desktop/
Dockerfile: https://github.com/kartoza/docker-qgis-desktop
Hint: This docker container requires X windows running on the host (LINUX or macOS are required!). For Windows download QGIS here: http://download.qgis.org
docker pull kartoza/qgis-desktop
QGIS 2.18:
xhost +
docker run --name gqis-desktop_2_18 -i -t -v /tmp/.X11-unix:/tmp/.X11-unix -v ${HOME}:/home/${USER} -e DISPLAY=unix:0 --link deegree:deegree --rm kartoza/qgis-desktop:2.18.17 '/usr/bin/qgis'
QGIS 2.18 (latest DEV):
xhost +
docker run --name gqis-desktop_master -i -t -v /tmp/.X11-unix:/tmp/.X11-unix -v ${HOME}:/home/${USER} -e DISPLAY=unix:0 --link deegree:deegree --rm kartoza/qgis-desktop:latest '/usr/bin/qgis'
WMS Endpoint for PS: http://localhost:8080/deegree-webservices/services/wms_ps
WMS Capabilities: http://localhost:8080/deegree-webservices/services/wms_ps?service=WMS&request=GetCapabilities
Docker hub: https://hub.docker.com/r/ogccite/teamengine-production/
Dockerfile: https://github.com/opengeospatial/teamengine-docker/
docker pull dstenger/teamengine-ets-all
docker run -d --name teamengine -p 8088:8080 --link deegree:deegree dstenger/teamengine-ets-all
Open in browser: http://localhost:8088/teamengine
Use either
to run the validation against.
Docker hub: https://hub.docker.com/r/iide/etf-webapp/
Dockerfile: https://github.com/interactive-instruments/etf-webapp
docker pull iide/etf-webapp
docker run --name etf -d -p 8188:8080 -v ~/etf:/etf --link deegree:deegree iide/etf-webapp:latest
Open in browser: http://localhost:8188/etf-webapp
To allow access to the local Docker Container running deegree you need to change the configuration file ~/etf/config/etf-config.properties
and set the property:
etf.testobject.allow.privatenet.access = true
More information how to configure the etf-web application under http://docs.etf-validator.net/ and https://github.com/inspire-eu-validation/ets-repository.
-
Can’t access docker from the command line -
- check if the docker daemon is running and use
sudo
- check if the docker daemon is running and use
-
Error while starting docker container -
-
check system resources if memory is still available
-
Remove the container with docker rm and re-run the container
-
-
For more hints and tips check https://docs.docker.com/toolbox/faqs/troubleshoot/
-
For Mac OS : https://docs.docker.com/docker-for-mac/troubleshoot/
-
For Windows: https://docs.docker.com/docker-for-windows/troubleshoot/
-
-
Can’t access the Docker container within Docker network then try the following
-
docker network create -d bridge --subnet 192.168.0.0/24 --gateway 192.168.0.1 inspirenet
-
docker network connect inspirenet deegree
-
docker network connect inspirenet etf
-
docker network connect inspirenet postgis
-
docker network connect inspirenet teamengine
-
And retry to access the Docker container
-
-
Can’t insert data into the database
-
Check if the user deegree has all needed privileges
-
Grant user deegree all privileges with:
-
GRANT ALL ON SCHEMA public TO deegree;
-
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO deegree;
-
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public to deegree;
-
-
General structure of the docker CLI:
docker <command> [options] [arguments]
Display help per docker command:
docker <command> --help
- Show help per docker command
Commands and options used within this tutorial:
-
docker info
- Display system-wide information -
docker images
- List images -
docker pull
- Pull an image or a repository from a registry (e.g. hub.docker.com) -
docker ps
- List containers- -a - Show all containers, incl. stopped containers
-
docker network ls
- List all networks -
docker run
- Run a command in a new container-
-d, --detach Run container in background and print container ID
-
-e, --env value Set environment variables (default [])
-
-i, --interactive Keep STDIN open even if not attached
-
--link value Add link to another container (default [] / )
-
-m, --memory string Memory limit (format: , where unit = b, k, m or g)
-
--name string Assign a name to the container
-
--network string Connect a container to a network (default "default" / [host, bridge]
-
-p, --publish value Publish a container's port(s) to the host (default [] / host:container)
-
--rm Automatically remove the container when it exits
-
-t, --tty Allocate a pseudo-TTY
-
-v, --volume value Bind mount a volume (default [] / host_dir:container_dir)
-
-
docker exec
- Run a command in a running container -
docker logs
- Fetch the logs of a container- -f, --follow - Follow log output
-
docker start
- Start one or more stopped containers -
docker stop
- Stop one or more running containers -
docker load
- Load a docker image from a tar archive file -
docker save
- Save a docker image into a tar archive file -
docker rm
- Remove one or more containers -
docker rmi
- Remove one or more images
FOSSGIS Konference 2018_Workshop ZIP-Bundle
- slides/01_T_Introduction.pdf
- slides/02_T_INSPIRE-Download-Services.pdf
- slides/03_TP_Docker.pdf
- slides/04_P_deegree-on-Docker.pdf
- slides/05_TP_deegree.pdf
- slides/06_P_Configuration-of-a-deegree-INSPIRE-Download-Service.pdf
- slides/07_TP_Validation-of-service-and-data.pdf
INSPIRE Conference 2017_Workshop ZIP-Bundle
http://linoxide.com/linux-how-to/run-gui-apps-docker-container/
Talk (german) - FOSSGIS 2018 - Dockerize stuff - Postgis swarm and other geo boxes
Video (german) - Docker für den GIS-Einsatz
Slides (english) - Spatial Data Processing with Docker
Video (german) - FOSS4G 2016 - Docker Images for Geospatial
Talk (english)- INSPIRE ready SDI using docker
https://github.com/deegree/deegree3
https://www.osgeo.org/projects/deegree/
https://www.fossgis.de/aktivit%c3%a4ten/langzeitf%c3%b6rderungen/deegree/
Documentation 3.3.x - https://download.deegree.org/documentation/3.3.21/html/
Documentation 3.4.x - https://download.deegree.org/documentation/current/html/
https://hub.docker.com/r/deegree/deegree3-docker/
https://github.com/de-bkg/deegree-workspace-dlm250-inspire
https://github.com/DirkThalheim/deegree-elf
https://github.com/eENVplus/deegree-workspace-eenvplus
https://github.com/opengeospatial/teamengine
http://opengeospatial.github.io/teamengine/
http://cite.opengeospatial.org
http://cite.opengeospatial.org/teamengine/
https://github.com/opengeospatial/teamengine-docker
http://www.slideshare.net/ChrisSchubert1/inspirehandsondatatransformation
http://inspire-geoportal.ec.europa.eu/validator2/
http://inspire-sandbox.jrc.ec.europa.eu/validator/
https://github.com/interactive-instruments/etf-test-projects-elf
https://github.com/Geonovum/etf-test-projects-inspire
http://inspire-regadmin.jrc.ec.europa.eu/dataspecification/ http://inspire.ec.europa.eu/Themes/Data-Specifications/2892
http://inspire.ec.europa.eu/events/conferences/inspire_2012/presentations/69.pdf
http://inspire-extensions.wetransform.to/tutorial/tutorial.html
http://grillmayer.eu/blog/#hale-projekt-inklusive-daten-protected-sites-austria
https://inspire-reference.jrc.ec.europa.eu/
https://live.osgeo.org/en/index.html
http://live.osgeo.org/en/overview/deegree_overview.html
https://wiki.osgeo.org/wiki/DockerImages
https://wiki.osgeo.org/wiki/INSPIRE
https://wiki.osgeo.org/wiki/INSPIRE_tools_inventory
WMS with OSM data
http://ows.terrestris.de/osm/service?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
This document is published under creative commons license.
Attribution - Non Commercial - Share Alike - 4.0 International (CC BY-NC-SA 4.0)