1+ # hadolint global ignore=DL3025,DL3040,DL3041,DL3059
12# Arguments
23ARG centos_stream_version=9
34ARG extra_repository=crb
45ARG mapnik_version=4.0.0
56
67# Mapnik Builder
7- FROM quay.io/centos/centos:stream${centos_stream_version} as mapnik-builder
8+ FROM quay.io/centos/centos:stream${centos_stream_version} AS mapnik-builder
89
910## Arguments
1011ARG centos_stream_version
1112ARG extra_repository
1213ARG mapnik_version
1314
1415## Install mapnik-builder dependencies
15- RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \
16+ RUN --mount=type=cache,sharing=locked, id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf \
1617 echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
1718 echo "keepcache=True" >> /etc/dnf/dnf.conf && \
1819 dnf --assumeyes install "dnf-command(config-manager)" && \
@@ -43,14 +44,14 @@ RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/
4344
4445## Download, Build & Install `Mapnik`
4546WORKDIR /tmp/mapnik_src
46- RUN --mount=id=centos:stream${centos_stream_version}-mapnik-src:${mapnik_version},target=/tmp/mapnik_src,type=cache \
47+ RUN --mount=type=cache, id=centos:stream${centos_stream_version}-mapnik-src:${mapnik_version},target=/tmp/mapnik_src \
4748 if [ ! -f CMakeLists.txt ]; then \
4849 git clone --branch v${mapnik_version} --depth 1 --jobs 8 --recurse-submodules https://github.com/mapnik/mapnik.git /tmp/mapnik_src; \
4950 fi
5051WORKDIR /tmp/mapnik_build
51- RUN --mount=id=centos:stream${centos_stream_version}-mapnik-src:${mapnik_version},target=/tmp/mapnik_src,type=cache \
52- --mount=id=centos:stream${centos_stream_version}-mapnik-build:${mapnik_version},target=/tmp/mapnik_build,type=cache \
53- export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) && \
52+ RUN --mount=type=cache, id=centos:stream${centos_stream_version}-mapnik-src:${mapnik_version},target=/tmp/mapnik_src \
53+ --mount=type=cache, id=centos:stream${centos_stream_version}-mapnik-build:${mapnik_version},target=/tmp/mapnik_build \
54+ CMAKE_BUILD_PARALLEL_LEVEL=" $(nproc)" && export CMAKE_BUILD_PARALLEL_LEVEL && \
5455 export DESTDIR=/tmp/mapnik && \
5556 cmake -B . -S /tmp/mapnik_src \
5657 -DBUILD_BENCHMARK:BOOL=OFF \
@@ -70,14 +71,14 @@ RUN --mount=id=centos:stream${centos_stream_version}-mapnik-src:${mapnik_version
7071 cmake --install . --strip
7172
7273# Builder
73- FROM quay.io/centos/centos:stream${centos_stream_version} as builder
74+ FROM quay.io/centos/centos:stream${centos_stream_version} AS builder
7475
7576## Arguments
7677ARG centos_stream_version
7778ARG extra_repository
7879
7980## Install builder dependencies
80- RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \
81+ RUN --mount=type=cache,sharing=locked, id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf \
8182 echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
8283 echo "keepcache=True" >> /etc/dnf/dnf.conf && \
8384 dnf --assumeyes install "dnf-command(config-manager)" && \
@@ -121,14 +122,14 @@ RUN export DESTDIR=/tmp/mod_tile && \
121122RUN make test
122123
123124# Runner
124- FROM quay.io/centos/centos:stream${centos_stream_version} as runner
125+ FROM quay.io/centos/centos:stream${centos_stream_version} AS runner
125126
126127## Arguments
127128ARG centos_stream_version
128129ARG extra_repository
129130
130131## Install runner dependencies
131- RUN --mount=id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf,type=cache,sharing=locked \
132+ RUN --mount=type=cache,sharing=locked, id=centos:stream${centos_stream_version}-/var/cache/dnf,target=/var/cache/dnf \
132133 echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
133134 echo "keepcache=True" >> /etc/dnf/dnf.conf && \
134135 dnf --assumeyes install "dnf-command(config-manager)" && \
@@ -162,13 +163,15 @@ COPY --from=builder \
162163 /etc/httpd/conf.d/renderd-example-map.conf
163164
164165## Fix mapnik directories
166+ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
165167RUN sed \
166168 --expression "s#/usr/lib/mapnik/3.1/input#$(find /usr -mindepth 1 -type d -name input | grep mapnik)#g" \
167169 --expression "s#/usr/share/fonts/truetype#/usr/share/fonts#g" \
168170 /usr/local/etc/renderd.conf > /etc/renderd.conf
171+ SHELL ["/bin/sh", "-c"]
169172
170173## Add configuration
171- RUN printf "LoadModule tile_module $(find /usr -name mod_tile.so)\n " > /etc/httpd/conf.modules.d/11-tile.conf
174+ RUN printf "LoadModule tile_module %s\n" " $(find /usr -name mod_tile.so)" > /etc/httpd/conf.modules.d/11-tile.conf
172175RUN printf '\n[example-map]\nMAXZOOM=20\nMINZOOM=0\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
173176RUN printf '\n[example-map-jpg]\nMAXZOOM=20\nMINZOOM=0\nTYPE=jpg image/jpeg jpeg\nURI=/tiles/renderd-example-jpg\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
174177RUN printf '\n[example-map-png256]\nMAXZOOM=20\nMINZOOM=0\nTYPE=png image/png png256\nURI=/tiles/renderd-example-png256\nXML=/usr/share/renderd/example-map/mapnik.xml\n' >> /etc/renderd.conf
0 commit comments