Indico-maps: container not building successfully with 2021 Dockerfile

Hi,

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: )

Michel

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 https://github.com/systemed/tilemaker.git && \
    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/

WORKDIR /maps

# get Switzerland map and crop it to the CERN area
#RUN wget https://download.geofabrik.de/europe/germany/bayern-latest.osm.pbf && \
#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- https://deb.nodesource.com/setup_16.x | 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+https://github.com/maptiler/tileserver-gl.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

ENV \
    NODE_ENV="production" \
    CHOKIDAR_USEPOLLING=1 \
    CHOKIDAR_INTERVAL=500

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- https://deb.nodesource.com/setup_16.x | 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

ARG 1
RUN mkdir -p /data
COPY --from=builder /maps/out/mlz.mbtiles /data/
COPY tileserver/config.json /data/
COPY styles /data/styles
COPY tileserver/docker-entrypoint.sh /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


WORKDIR /data


CMD [""]
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh" ]
~                                                                                                                                                                                                                               

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…

Michel

FYI, the build is now fixed in the latest git master

1 Like