Indico-maps: container not building successfully with 2021 Dockerfile


As I was moving our indico-maps container to a new server, I wanted to update it with the last version of GitHub - indico/indico-maps: Tileserver microservice for Indico Maps (Room Booking). Unfortunately, I have not been able to build it sucessfully as the last version of the Dockerfile uses Debian Buster (10) but one of the node.js dependency, maplibre-gl, has its version locked to a version that requires libjpeg8, not available in Debian Buster and, AFAIK, with no optional package providing it.

Did I miss something? (I guess so :slight_smile: )


I have a build with bullseye (debian-11) for creating the intermediate files and ubuntu: focal for the final image:

# Build stage
FROM debian:bullseye as builder

RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
    apt-get install -y build-essential lua5.1-0 liblua5.1-0-dev libprotobuf-dev libsqlite3-dev protobuf-compiler\
                       shapelib libshp-dev libboost-all-dev osmctools git rapidjson-dev

RUN mkdir -p /maps/out

RUN cd /tmp && \
    git clone && \
    cd tilemaker &&\
    git checkout master && \
    make && \
    make install

# config file and process script for tilemaker
COPY tilemaker/tiles.json tilemaker/process.lua /maps/
COPY shapes/* maps/shapes/


# get Switzerland map and crop it to the CERN area
#RUN wget && \
#COPY bayern-latest.osm.pbf . 
#RUN   osmconvert ./bayern-latest.osm.pbf --complete-ways --out-pbf -b=11.635,48.246,11.721,48.285 > ./mlz.osm.pbf
# &lat=48.28416&lon=11.72099 => upper right
# l?zoom=14&lat=48.25959&lon=11.66537&layers=000BTT => center
# lat=48.24651&lon=11.63525 => lower left

COPY mlz.osm.pbf /maps/mlz.osm.pbf
# transform OSM data into vector tiles (.mbtiles file)
RUN tilemaker ./mlz.osm.pbf --config tiles.json --output ./out/mlz.mbtiles

FROM ubuntu:focal AS builder2

ENV NODE_ENV="production"

RUN set -ex; \
    export DEBIAN_FRONTEND=noninteractive; \
    apt-get -qq update; \
    apt-get -y --no-install-recommends install \
      build-essential \
      ca-certificates \
      git \
      wget \
      pkg-config \
      xvfb \
      libglfw3-dev \
      libuv1-dev \
      libjpeg-turbo8 \
      libicu66 \
      libcairo2-dev \
      libpango1.0-dev \
      libjpeg-dev \
      libgif-dev \
     librsvg2-dev \
      libcurl4-openssl-dev \
      libpixman-1-dev; \
    wget -qO- | bash; \
    apt-get install -y nodejs; \
    apt-get -y remove wget; \
    apt-get -y --purge autoremove; \
    apt-get clean; \
    rm -rf /var/lib/apt/lists/*;

RUN mkdir /usr/src/app \
   && cd /usr/src/app \
   && npm install --omit=dev git+

# second stage, the tile server
# we're not using klokantech/tileserver-gl-light directly because
# it sets /data as a VOLUME, and we want the data to be included
# in the image

FROM ubuntu:focal AS final

    NODE_ENV="production" \

RUN set -ex; \
    export DEBIAN_FRONTEND=noninteractive; \
    groupadd -r node; \
    useradd -r -g node node; \
    apt-get -qq update; \
    apt-get -y --no-install-recommends install \
      ca-certificates \
      wget \
      xvfb \
      libglfw3 \
      libuv1 \
      libjpeg-turbo8 \
      libicu66 \
      libcairo2 \
      libgif7 \
      libopengl0 \
      libpixman-1-0 \
      libcurl4 \
      librsvg2-2 \
      libpango1.0; \
    wget -qO- | bash; \
    apt-get install -y nodejs; \
    apt-get -y remove wget; \
    apt-get -y --purge autoremove; \
    apt-get clean; \
    rm -rf /var/lib/apt/lists/*;
COPY --from=builder2 /usr/src/app /usr/src/app

RUN mkdir -p /data
COPY --from=builder /maps/out/mlz.mbtiles /data/
COPY tileserver/config.json /data/
COPY styles /data/styles
COPY tileserver/ /usr/src/app
COPY tileserver-gl/src /usr/src/app/src
COPY tileserver-gl/public /usr/src/app/public
COPY tileserver-gl/package* /usr/src/app


CMD [""]
ENTRYPOINT ["/usr/src/app/" ]

Thanks. I’ll give it a try. I tried Bullseye without success using the original Dockerfile but probably I As yours seems a bit different, it may fix the problems…