Search code examples
dockerfilegeoservervector-tiles

GeoServer is not recognizing the copied gwc-layers files


I want to generate a docker image for GeoServer adding my gwc-layers of the GeoServer instance I'm running locally. For that, I copied the data_dir from my local GeoServer and created the following Dockerfile:

FROM kartoza/geoserver

COPY data_dir/user_projections/epsg.properties /opt/geoserver/data_dir/user_projections/
COPY data_dir/workspaces /opt/geoserver/data_dir/workspaces
COPY data_dir/security /opt/geoserver/data_dir/security
COPY data_dir/styles /opt/geoserver/data_dir/styles
COPY data_dir/gwc-layers /opt/geoserver/data_dir/gwc-layers

The files I have defined in the gwc-layers folder look like this:

<GeoServerTileLayer>
  <id>LayerInfoImpl--6dbd5e0d:1753f922e52:-6c1c</id>
  <enabled>true</enabled>
  <inMemoryCached>true</inMemoryCached>
  <name>myworkspace:parcels</name>
  <mimeFormats>
    <string>application/vnd.mapbox-vector-tile</string>
    <string>image/png</string>
    <string>image/jpeg</string>
  </mimeFormats>
  <gridSubsets>
    <gridSubset>
      <gridSetName>EPSG:4326</gridSetName>
    </gridSubset>
    <gridSubset>
      <gridSetName>EPSG:900913</gridSetName>
    </gridSubset>
  </gridSubsets>
  <metaWidthHeight>
    <int>4</int>
    <int>4</int>
  </metaWidthHeight>
  <expireCache>0</expireCache>
  <expireClients>0</expireClients>
  <parameterFilters>
    <styleParameterFilter>
      <key>STYLES</key>
      <defaultValue></defaultValue>
      <availableStyles class="sorted-set"/>
      <defaultStyle>generic</defaultStyle>
    </styleParameterFilter>
  </parameterFilters>
  <gutter>0</gutter>
</GeoServerTileLayer>

Note that all the layers have the MVT tile image format defined through application/vnd.mapbox-vector-tile.

However, after building the Docker image and run it, all my workspace, datastore, layers are listed correctly, but none of the layers has the option application/vnd.mapbox-vector-tile checked.

enter image description here

It seems the files inside gwc-layers are being modified or ignored/regenerated.


Solution

  • The default tile formats are stored in the gwc-gs.xml file (in the top level data dir) so you'll need to copy that across too.