ConservationMetrics / mapgl-tile-renderer

Headless Node.js Maplibre-GL renderer for generating MBTiles with styled raster tiles.
MIT License
11 stars 3 forks source link

Add Dockerfile #8

Closed luandro closed 8 months ago

luandro commented 8 months ago

Done!

Working Dockerfile and workflow for deploying to Docker Hub. Need to change code to use CMI DockerHub.

Roadmap

Error 1:

Error: libicui18n.so.70: cannot open shared object file: No such file or directory

Solved: Use Ubuntu 22.04 and Node v18.17

Error 2:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to open X display.

Related to: https://github.com/mapbox/mapbox-gl-native/issues/4922, https://github.com/maptiler/tileserver-gl/issues/345

Solved: Use entryscript that starts xvfb

rudokemper commented 8 months ago

As it stands, running a Docker image built with this Dockerfile produces this error, which seems to also be happening in arch architecture:

  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libicui18n.so.70: cannot open shared object file: No such file or directory
    at Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/app/node_modules/@maplibre/maplibre-gl-native/platform/node/index.js:5:12)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.17.0

I tried to substitute the libicu66 downloads for libicu70, but that has a compatibility issue with the base image. So this will require some work. Maybe we need to pursue a multi-stage built where Maplibre native is built in an environment with the right ICU version, and then copied over to this image?

luandro commented 8 months ago

Still has error with display.