Make PyGeoAPI to run rootless (Tested in Openshift) #2088
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR aims to modify mininal things in entrypoint script to allow the container to run as a non-root user. This is specially important to Openshift because it was denied by default to run rooted containers.
this PR could be summarized in two items:
This is important because the entrypoint script tries to generate OpenAPI yaml, and the pygeoapi executable can't create on his own dir. We set the env to write in /tmp dir.
Related Issue / discussion
Add/Update container offerings: #1753
Additional information
This two modifications, in addition to set CONTAINER_PORT > 1024 (we used 8080) allowed us to run pygeoapi in OpenShift with default security configurations.
docker run example:
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)