citygml4j / citygml-tools

Collection of tools for processing CityGML files
Apache License 2.0
124 stars 19 forks source link

Provide docker image #10

Closed kdeininger closed 4 years ago

kdeininger commented 4 years ago

Description

This PR provides a Docker image to run citygml-tools inside a container without installing any Java dependencies on the host. Please feel free to use this image and publish it on an image registry of your choice.

Technical details

It uses Alpine Linux to keep the resulting images small. Additionally, it is written as multi-stage image, which means the "JDK image" is only used for building, while the final application gets wrapped in a smaller "JRE image".

By default, the container process is executed as non-root user. The included entrypoint script allows the image also to be used in OpenShift environments, where an arbitrary user might be created on container start.

The default working directory inside the container is /data.

Usage

  1. Build the image, e.g.

    docker build -t citygml-tools .
  2. By default, running the container shows the help message

    docker run --rm citygml-tools
  3. Mount a volume and run any other citycml-tools command, e.g.

    docker run --rm -u 1000 -v /my/cityjson/data:/data citygml-tools from-cityjson /data

    Notes:

    • In this case, citygml-tools is the name of the image.
    • Use the -u parameter to pass the user ID of your current host's user to set the right permissions on generated files in the mounted directory.
clausnagel commented 4 years ago

Great work, thanks for your contribution! I am not too familiar with registering docker images. Can you recommend an image registry?

kdeininger commented 4 years ago

Thanks for your reply!

There are many registries available to host container images. I would recommend one of the following:

Maybe you should give GitHub Packages a try. Please let me know, if you need further information.