Skip to content

Commit 199d6ed

Browse files
terencehonlesstrk
authored andcommitted
fix: update NPROC to be only a build argument
This change fixes the ``NPROC`` build argument persisting in the container's runtime environment.
1 parent bd55962 commit 199d6ed

File tree

11 files changed

+48
-56
lines changed

11 files changed

+48
-56
lines changed

13-3.5/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:13-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.5.4 spatial database extension with PostgreSQL 13 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

14-3.5/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:14-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.5.4 spatial database extension with PostgreSQL 14 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

15-3.5/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:15-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.5.4 spatial database extension with PostgreSQL 15 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

16-3.5/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:16-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.5.4 spatial database extension with PostgreSQL 16 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

16-master/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
ARG DOCKER_CMAKE_BUILD_TYPE=Release
99
ARG CGAL_GIT_BRANCH=main
10+
ARG NPROC=
1011
FROM docker.io/postgres:16-bullseye as builder
1112

1213
ARG NPROC
13-
ENV NPROC=${NPROC}
1414

1515
LABEL maintainer="PostGIS Project - https://postgis.net" \
1616
org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 16 bullseye" \
@@ -131,7 +131,7 @@ RUN set -ex \
131131
-DSFCGAL_BUILD_EXAMPLES=OFF \
132132
-DSFCGAL_BUILD_TESTS=OFF \
133133
-DSFCGAL_WITH_OSG=OFF \
134-
&& make -j${NPROC:=$(nproc)} \
134+
&& make -j${NPROC:-$(nproc)} \
135135
&& make install \
136136
#
137137
## testing with -DSFCGAL_BUILD_TESTS=ON
@@ -155,7 +155,7 @@ RUN set -ex \
155155
&& echo "autotools version: 'autogen.sh' exists! Older version!" \
156156
&& ./autogen.sh \
157157
&& ./configure --disable-static \
158-
&& make -j${NPROC:=$(nproc)} \
158+
&& make -j${NPROC:-$(nproc)} \
159159
&& make install \
160160
; \
161161
else \
@@ -164,7 +164,7 @@ RUN set -ex \
164164
&& mkdir build \
165165
&& cd build \
166166
&& cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
167-
&& make -j${NPROC:=$(nproc)} \
167+
&& make -j${NPROC:-$(nproc)} \
168168
&& make install \
169169
; \
170170
fi \
@@ -182,7 +182,7 @@ RUN set -ex \
182182
&& mkdir cmake-build \
183183
&& cd cmake-build \
184184
&& cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
185-
&& make -j${NPROC:=$(nproc)} \
185+
&& make -j${NPROC:-$(nproc)} \
186186
&& make install \
187187
&& cd / \
188188
&& rm -fr /usr/src/geos
@@ -252,7 +252,7 @@ RUN set -ex \
252252
; \
253253
fi \
254254
\
255-
&& make -j${NPROC:=$(nproc)} \
255+
&& make -j${NPROC:-$(nproc)} \
256256
&& make install \
257257
&& cd / \
258258
&& rm -fr /usr/src/gdal
@@ -392,7 +392,7 @@ RUN set -ex \
392392
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
393393
&& ./configure \
394394
--enable-lto \
395-
&& make -j${NPROC:=$(nproc)} \
395+
&& make -j${NPROC:-$(nproc)} \
396396
&& make install \
397397
# refresh proj data - workarounds: https://trac.osgeo.org/postgis/ticket/5316
398398
&& projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \
@@ -406,7 +406,7 @@ RUN set -ex \
406406
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
407407
&& ldconfig \
408408
&& cd regress \
409-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
409+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
410410
\
411411
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
412412
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

17-3.5/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:17-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.5.4 spatial database extension with PostgreSQL 17 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

17-3.6/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:17-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.6.1 spatial database extension with PostgreSQL 17 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

17-master/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
ARG DOCKER_CMAKE_BUILD_TYPE=Release
99
ARG CGAL_GIT_BRANCH=main
10+
ARG NPROC=
1011
FROM docker.io/postgres:17-bullseye as builder
1112

1213
ARG NPROC
13-
ENV NPROC=${NPROC}
1414

1515
LABEL maintainer="PostGIS Project - https://postgis.net" \
1616
org.opencontainers.image.description="PostGIS - master spatial database extension with PostgreSQL 17 bullseye" \
@@ -131,7 +131,7 @@ RUN set -ex \
131131
-DSFCGAL_BUILD_EXAMPLES=OFF \
132132
-DSFCGAL_BUILD_TESTS=OFF \
133133
-DSFCGAL_WITH_OSG=OFF \
134-
&& make -j${NPROC:=$(nproc)} \
134+
&& make -j${NPROC:-$(nproc)} \
135135
&& make install \
136136
#
137137
## testing with -DSFCGAL_BUILD_TESTS=ON
@@ -155,7 +155,7 @@ RUN set -ex \
155155
&& echo "autotools version: 'autogen.sh' exists! Older version!" \
156156
&& ./autogen.sh \
157157
&& ./configure --disable-static \
158-
&& make -j${NPROC:=$(nproc)} \
158+
&& make -j${NPROC:-$(nproc)} \
159159
&& make install \
160160
; \
161161
else \
@@ -164,7 +164,7 @@ RUN set -ex \
164164
&& mkdir build \
165165
&& cd build \
166166
&& cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
167-
&& make -j${NPROC:=$(nproc)} \
167+
&& make -j${NPROC:-$(nproc)} \
168168
&& make install \
169169
; \
170170
fi \
@@ -182,7 +182,7 @@ RUN set -ex \
182182
&& mkdir cmake-build \
183183
&& cd cmake-build \
184184
&& cmake .. -DCMAKE_BUILD_TYPE=${DOCKER_CMAKE_BUILD_TYPE} -DBUILD_TESTING=OFF \
185-
&& make -j${NPROC:=$(nproc)} \
185+
&& make -j${NPROC:-$(nproc)} \
186186
&& make install \
187187
&& cd / \
188188
&& rm -fr /usr/src/geos
@@ -252,7 +252,7 @@ RUN set -ex \
252252
; \
253253
fi \
254254
\
255-
&& make -j${NPROC:=$(nproc)} \
255+
&& make -j${NPROC:-$(nproc)} \
256256
&& make install \
257257
&& cd / \
258258
&& rm -fr /usr/src/gdal
@@ -392,7 +392,7 @@ RUN set -ex \
392392
# https://anonscm.debian.org/cgit/pkg-grass/postgis.git/tree/debian/rules?h=jessie
393393
&& ./configure \
394394
--enable-lto \
395-
&& make -j${NPROC:=$(nproc)} \
395+
&& make -j${NPROC:-$(nproc)} \
396396
&& make install \
397397
# refresh proj data - workarounds: https://trac.osgeo.org/postgis/ticket/5316
398398
&& projsync --system-directory --file ch_swisstopo_CHENyx06_ETRS \
@@ -406,7 +406,7 @@ RUN set -ex \
406406
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
407407
&& ldconfig \
408408
&& cd regress \
409-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
409+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
410410
\
411411
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
412412
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

18-3.6/alpine/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:18-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS 3.6.1 spatial database extension with PostgreSQL 18 Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

Dockerfile.alpine.template

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
ARG BASE_IMAGE=postgres:%%PG_MAJOR%%-alpine3.22
55
FROM ${BASE_IMAGE}
66

7-
ARG NPROC
8-
ENV NPROC=${NPROC}
7+
ARG NPROC=
98

109
LABEL maintainer="PostGIS Project - https://postgis.net" \
1110
org.opencontainers.image.description="PostGIS %%POSTGIS_VERSION%% spatial database extension with PostgreSQL %%PG_MAJOR%% Alpine" \
@@ -65,7 +64,7 @@ RUN set -eux \
6564
&& ./autogen.sh \
6665
&& ./configure \
6766
--enable-lto \
68-
&& make -j${NPROC:=$(nproc)} \
67+
&& make -j${NPROC:-$(nproc)} \
6968
&& make install \
7069
\
7170
# This section is for refreshing the proj data for the regression tests.
@@ -81,7 +80,7 @@ RUN set -eux \
8180
&& su postgres -c 'pg_ctl -D /tempdb init' \
8281
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
8382
&& cd regress \
84-
&& make -j${NPROC:=$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
83+
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8584
\
8685
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \
8786
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis_raster;"' \

0 commit comments

Comments
 (0)