@@ -40,14 +40,13 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
4040 postgresql-devel \
4141 proj-devel \
4242 python3 \
43- python3-scons \
4443 sqlite-devel \
4544 tar \
4645 zlib-devel
4746
4847## Download, Build & Install `Mapnik`
49- WORKDIR /usr/local/src/mapnik
50- RUN --mount=id=centos:stream${centos_stream_version}-mapnik:${mapnik_version},target=/usr/local/src/mapnik ,type=cache \
48+ WORKDIR /tmp/mapnik_src
49+ RUN --mount=id=centos:stream${centos_stream_version}-mapnik:${mapnik_version},target=/tmp/mapnik_src ,type=cache \
5150 export DESTDIR="/tmp/mapnik"; \
5251 export GDAL_DATA="$(gdal-config --datadir)"; \
5352 export JOBS="$(nproc)"; \
@@ -65,14 +64,13 @@ RUN --mount=id=centos:stream${centos_stream_version}-mapnik:${mapnik_version},ta
6564 fi \
6665 fi; \
6766 if [ "${centos_stream_version}" = "8" ]; then \
68- export SCONS_CMD="scons-3"; \
69- export CUSTOM_CFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; \
70- export CUSTOM_CXXFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"; \
67+ export CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; \
7168 fi; \
72- ${SCONS_CMD:-scons} configure \
69+ bash configure \
7370 CPP_TESTS=False \
7471 CUSTOM_CFLAGS="${CUSTOM_CFLAGS:-}" \
7572 CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS:-}" \
73+ CUSTOM_DEFINES="${CUSTOM_DEFINES:-}" \
7674 CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS:-}" \
7775 DEMO=False \
7876 DESTDIR="${DESTDIR}" \
@@ -133,12 +131,11 @@ COPY --from=mapnik-builder /tmp/mapnik /
133131## Build, Test & Install `mod_tile`
134132COPY . /tmp/mod_tile_src
135133WORKDIR /tmp/mod_tile_src
136- RUN ./autogen.sh && \
137- ./configure && \
138- make
139134RUN export DESTDIR=/tmp/mod_tile && \
140- ./gen_tile_test && \
135+ ./autogen.sh && \
136+ ./configure && \
141137 make DESTDIR=${DESTDIR} install install-mod_tile
138+ RUN ./gen_tile_test
142139
143140# Runner
144141FROM quay.io/centos/centos:stream${centos_stream_version} as runner
@@ -184,15 +181,23 @@ COPY --from=builder \
184181 /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf \
185182 /etc/httpd/conf.d/renderd-example-map.conf
186183
187- RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n" > /etc/httpd/conf.modules.d/11-tile.conf
188-
184+ ## Fix mapnik directories
189185RUN sed \
190186 --expression "s#/usr/lib/mapnik/3.1/input#$(find /usr -mindepth 1 -type d -name input)#g" \
191187 --expression "s#/usr/share/fonts/truetype#/usr/share/fonts#g" \
192- /usr/local/etc/renderd.conf > /etc/renderd.conf && \
193- printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
188+ /usr/local/etc/renderd.conf > /etc/renderd.conf
189+
190+ ## Add configuration
191+ RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n" > /etc/httpd/conf.modules.d/11-tile.conf
192+ RUN printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
193+ RUN printf '\n[example-map-jpg]\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
194+ RUN printf '\n[example-map-png256]\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
195+ RUN printf '\n[example-map-png32]\nTYPE=png image/png png32\nURI=/tiles/renderd-example-png32\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
196+ RUN printf '\n[example-map-webp]\nTYPE=webp image/webp webp\nURI=/tiles/renderd-example-webp\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
194197
198+ ## Create missing directories
195199RUN mkdir --parents /run/renderd /var/cache/renderd/tiles
196200
197- CMD /usr/sbin/httpd -e debug -k start; \
201+ ## Start services
202+ CMD httpd -e debug -k start; \
198203 G_MESSAGES_DEBUG=${G_MESSAGES_DEBUG:-info} renderd --foreground
0 commit comments