@@ -9,6 +9,9 @@ ARG DOCKER_CMAKE_BUILD_TYPE=Release
99ARG CGAL_GIT_BRANCH=main
1010FROM docker.io/postgres:16-bullseye as builder
1111
12+ ARG NPROC
13+ ENV NPROC=${NPROC}
14+
1215LABEL maintainer="PostGIS Project - https://postgis.net" \
1316 org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 16 bullseye" \
1417 org.opencontainers.image.source="https://github.com/postgis/docker-postgis"
@@ -128,7 +131,7 @@ RUN set -ex \
128131 -DSFCGAL_BUILD_EXAMPLES=OFF \
129132 -DSFCGAL_BUILD_TESTS=OFF \
130133 -DSFCGAL_WITH_OSG=OFF \
131- && make -j$(nproc) \
134+ && make -j${NPROC:=$ (nproc)} \
132135 && make install \
133136 #
134137 # # testing with -DSFCGAL_BUILD_TESTS=ON
@@ -152,7 +155,7 @@ RUN set -ex \
152155 && echo "autotools version: 'autogen.sh' exists! Older version!" \
153156 && ./autogen.sh \
154157 && ./configure --disable-static \
155- && make -j$(nproc) \
158+ && make -j${NPROC:=$ (nproc)} \
156159 && make install \
157160 ; \
158161 else \
@@ -161,7 +164,7 @@ RUN set -ex \
161164 && mkdir build \
162165 && cd build \
163166 && cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
164- && make -j$(nproc) \
167+ && make -j${NPROC:=$ (nproc)} \
165168 && make install \
166169 ; \
167170 fi \
@@ -179,7 +182,7 @@ RUN set -ex \
179182 && mkdir cmake-build \
180183 && cd cmake-build \
181184 && cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
182- && make -j$(nproc) \
185+ && make -j${NPROC:=$ (nproc)} \
183186 && make install \
184187 && cd / \
185188 && rm -fr /usr/src/geos
@@ -249,7 +252,7 @@ RUN set -ex \
249252 ; \
250253 fi \
251254 \
252- && make -j$(nproc) \
255+ && make -j${NPROC:=$ (nproc)} \
253256 && make install \
254257 && cd / \
255258 && rm -fr /usr/src/gdal
@@ -271,6 +274,7 @@ RUN set -ex \
271274# -------------------------------------------
272275FROM docker.io/postgres:16-bullseye
273276
277+ ARG NPROC
274278ARG DOCKER_CMAKE_BUILD_TYPE
275279ENV DOCKER_CMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE}
276280
@@ -388,7 +392,7 @@ RUN set -ex \
388392# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
389393 && ./configure \
390394 --enable-lto \
391- && make -j$(nproc) \
395+ && make -j${NPROC:=$ (nproc)} \
392396 && make install \
393397# refresh proj data - workarounds: https://trac.osgeo.org/postgis/ticket/5316
394398 && projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \
@@ -402,7 +406,7 @@ RUN set -ex \
402406 && su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o ' -F' start ' \
403407 && ldconfig \
404408 && cd regress \
405- && make -j$(nproc) check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
409+ && make -j${NPROC:=$ (nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
406410 \
407411 && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
408412 && su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \
0 commit comments