Geonovum / ogc-api-testbed

OGC API Testbed Template - Stable
https://apitestbed.geonovum.nl
GNU General Public License v3.0
4 stars 4 forks source link

GeoServer changes file ownership within Docker Container #25

Closed justb4 closed 3 years ago

justb4 commented 3 years ago

See e.g. this screenshot, after updating config: image

e.g.

oadmin@OGCAPIP:~/git$ sudo ls -l services/geoserver/data/gwc-layers/LayerInfoImpl--5aa50211_17a007a58ce_-7fd0.xml
-rw-r----- 1 1099 1099 1425 Jun 14 10:39 services/geoserver/data/gwc-layers/LayerInfoImpl--5aa50211_17a007a58ce_-7fd0.xml

So uid is set to 1099 (Tomcat user id) which is not equal to the host uid (oadmin).

Solution

See https://github.com/oscarfonts/docker-geoserver under Running:

 Custom UID and GID
 The tomcat user uid and gid can be customized with CUSTOM_UID and CUSTOM_GID environment variables, so that the 
 mounted data_dir and exts_dir are accessible by both geoserver and a given host user. Usage example:

docker run -d -p 8080:8080 -e CUSTOM_UID=$(id -u) -e CUSTOM_GID=$(id -g) oscarfonts/geoserver