Skip to content

Commit

Permalink
docker: print HTTP errors on failure
Browse files Browse the repository at this point in the history
The -q parameter to wget makes it completely
silent, even on faliure which gives build errors
that are difficult to diagnose. Someone
else had the same problem 15 years ago:

https://serverfault.com/questions/70889/wget-to-print-errors-but-nothing-otherwise

and the easiest way to robustly print
errors but nothing else seems to be
to use curl instead.

Since the docker images already include
curl, switch them to use that instead.
  • Loading branch information
pjonsson committed Oct 4, 2024
1 parent f1f750e commit 37ff703
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions docker/alpine-normal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ARG HDF4_VERSION=4.2.16
RUN if test "${HDF4_VERSION}" != "" -a "$(uname -m)" = "x86_64"; then ( \
apk add --no-cache byacc flex portablexdr-dev \
&& mkdir hdf4 \
&& wget -q https://support.hdfgroup.org/ftp/HDF/releases/HDF${HDF4_VERSION}/src/hdf-${HDF4_VERSION}.tar.gz -O - \
&& curl -L -fsS https://support.hdfgroup.org/ftp/HDF/releases/HDF${HDF4_VERSION}/src/hdf-${HDF4_VERSION}.tar.gz \
| tar xz -C hdf4 --strip-components=2 \
&& cd hdf4 \
&& LDFLAGS=-lportablexdr ./configure --prefix=/usr --enable-shared --disable-static \
Expand All @@ -117,7 +117,7 @@ RUN if test "${HDF4_VERSION}" != "" -a "$(uname -m)" = "x86_64"; then ( \
# Build libOpenDRIVE
ARG OPENDRIVE_VERSION=0.6.0-gdal
RUN if test "${OPENDRIVE_VERSION}" != ""; then ( \
wget -q https://github.com/DLR-TS/libOpenDRIVE/archive/refs/tags/${OPENDRIVE_VERSION}.tar.gz \
curl -LO -fsS https://github.com/DLR-TS/libOpenDRIVE/archive/refs/tags/${OPENDRIVE_VERSION}.tar.gz \
&& tar xzf ${OPENDRIVE_VERSION}.tar.gz \
&& rm -f ${OPENDRIVE_VERSION}.tar.gz \
&& cd libOpenDRIVE-${OPENDRIVE_VERSION} \
Expand All @@ -138,7 +138,7 @@ ARG RSYNC_REMOTE
# Build PROJ
ARG PROJ_VERSION=master
RUN mkdir proj \
&& wget -q https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz \
| tar xz -C proj --strip-components=1 \
&& cd proj \
&& if test "${RSYNC_REMOTE}" != ""; then \
Expand Down Expand Up @@ -178,7 +178,7 @@ RUN mkdir proj \
# Build spatialite
ARG SPATIALITE_VERSION=5.1.0
RUN if test "${SPATIALITE_VERSION}" != "" -a "$(uname -m)" = "x86_64"; then ( \
wget -q https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${SPATIALITE_VERSION}.tar.gz \
curl -LO -fsS https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${SPATIALITE_VERSION}.tar.gz \
&& tar xzf libspatialite-${SPATIALITE_VERSION}.tar.gz \
&& rm -f libspatialite-${SPATIALITE_VERSION}.tar.gz \
&& cd libspatialite-${SPATIALITE_VERSION} \
Expand Down Expand Up @@ -231,7 +231,7 @@ RUN if test "${GDAL_VERSION}" = "master"; then \
&& export LDFLAGS="-lportablexdr ${LDFLAGS}"; \
fi \
&& mkdir gdal \
&& wget -q https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz \
| tar xz -C gdal --strip-components=1 \
&& cd gdal \
&& if test "${RSYNC_REMOTE}" != ""; then \
Expand Down
8 changes: 4 additions & 4 deletions docker/alpine-small/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apk add --no-cache \
#ARG OPENJPEG_VERSION=2.3.1
RUN if test "${OPENJPEG_VERSION}" != ""; then ( \
apk add --no-cache cmake \
&& wget -q https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
&& curl -LO -fsS https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
&& tar xzf v${OPENJPEG_VERSION}.tar.gz \
&& rm -f v${OPENJPEG_VERSION}.tar.gz \
&& cd openjpeg-${OPENJPEG_VERSION} \
Expand All @@ -46,7 +46,7 @@ RUN apk add --no-cache rsync ccache
ARG PROJ_DATUMGRID_LATEST_LAST_MODIFIED
RUN \
mkdir -p /build_projgrids/usr/share/proj \
&& curl -LOs http://download.osgeo.org/proj/proj-datumgrid-latest.zip \
&& curl -LO -fsS http://download.osgeo.org/proj/proj-datumgrid-latest.zip \
&& unzip -q -j -u -o proj-datumgrid-latest.zip -d /build_projgrids/usr/share/proj \
&& rm -f *.zip

Expand All @@ -56,7 +56,7 @@ ARG RSYNC_REMOTE
ARG PROJ_VERSION=master
RUN mkdir proj \
&& apk add --no-cache cmake \
&& wget -q https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz \
| tar xz -C proj --strip-components=1 \
&& cd proj \
&& if test "${RSYNC_REMOTE}" != ""; then \
Expand Down Expand Up @@ -118,7 +118,7 @@ RUN if test "${GDAL_VERSION}" = "master"; then \
ccache -M 1G; \
fi \
&& mkdir gdal \
&& wget -q https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz \
| tar xz -C gdal --strip-components=1 \
&& cd gdal \
&& mkdir build \
Expand Down
20 changes: 10 additions & 10 deletions docker/ubuntu-full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
# Build likbkea
ARG KEA_VERSION=1.5.2
RUN . /buildscripts/bh-set-envvars.sh \
&& wget -q https://github.com/ubarsc/kealib/archive/kealib-${KEA_VERSION}.zip \
&& curl -LO -fsS https://github.com/ubarsc/kealib/archive/kealib-${KEA_VERSION}.zip \
&& unzip -q kealib-${KEA_VERSION}.zip \
&& rm -f kealib-${KEA_VERSION}.zip \
&& cd kealib-kealib-${KEA_VERSION} \
Expand All @@ -93,7 +93,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG MONGO_C_DRIVER_VERSION=1.24.4
RUN . /buildscripts/bh-set-envvars.sh \
&& mkdir mongo-c-driver \
&& wget -q https://github.com/mongodb/mongo-c-driver/releases/download/${MONGO_C_DRIVER_VERSION}/mongo-c-driver-${MONGO_C_DRIVER_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/mongodb/mongo-c-driver/releases/download/${MONGO_C_DRIVER_VERSION}/mongo-c-driver-${MONGO_C_DRIVER_VERSION}.tar.gz \
| tar xz -C mongo-c-driver --strip-components=1 \
&& cd mongo-c-driver \
&& mkdir build_cmake \
Expand All @@ -112,7 +112,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG MONGOCXX_VERSION=3.8.1
RUN . /buildscripts/bh-set-envvars.sh \
&& mkdir mongocxx \
&& wget -q https://github.com/mongodb/mongo-cxx-driver/archive/r${MONGOCXX_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/mongodb/mongo-cxx-driver/archive/r${MONGOCXX_VERSION}.tar.gz \
| tar xz -C mongocxx --strip-components=1 \
&& cd mongocxx \
&& mkdir build_cmake \
Expand All @@ -136,7 +136,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
libspdlog-dev${APT_ARCH_SUFFIX} libmagic-dev${APT_ARCH_SUFFIX} \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir tiledb \
&& wget -q https://github.com/TileDB-Inc/TileDB/archive/${TILEDB_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/TileDB-Inc/TileDB/archive/${TILEDB_VERSION}.tar.gz \
| tar xz -C tiledb --strip-components=1 \
&& cd tiledb \
&& patch -p0 < /buildscripts/tiledb-FindLZ4_EP.cmake.patch \
Expand All @@ -156,7 +156,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG OPENJPEG_VERSION=
RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${OPENJPEG_VERSION}" != ""; then ( \
wget -q https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
curl -LO -fsS https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
&& tar xzf v${OPENJPEG_VERSION}.tar.gz \
&& rm -f v${OPENJPEG_VERSION}.tar.gz \
&& cd openjpeg-${OPENJPEG_VERSION} \
Expand All @@ -177,7 +177,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG OPENDRIVE_VERSION=0.6.0-gdal
RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${OPENDRIVE_VERSION}" != ""; then ( \
wget -q https://github.com/DLR-TS/libOpenDRIVE/archive/refs/tags/${OPENDRIVE_VERSION}.tar.gz \
curl -LO -fsS https://github.com/DLR-TS/libOpenDRIVE/archive/refs/tags/${OPENDRIVE_VERSION}.tar.gz \
&& tar xzf ${OPENDRIVE_VERSION}.tar.gz \
&& rm -f ${OPENDRIVE_VERSION}.tar.gz \
&& cd libOpenDRIVE-${OPENDRIVE_VERSION} \
Expand All @@ -197,7 +197,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG WITH_FILEGDB=
RUN . /buildscripts/bh-set-envvars.sh \
&& if echo "$WITH_FILEGDB" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \
wget -q https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.2/FileGDB_API-RHEL7-64gcc83.tar.gz \
curl -LO -fsS https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.2/FileGDB_API-RHEL7-64gcc83.tar.gz \
&& tar -xzf FileGDB_API-RHEL7-64gcc83.tar.gz \
&& chown -R root:root FileGDB_API-RHEL7-64gcc83 \
&& mv FileGDB_API-RHEL7-64gcc83 /usr/local/FileGDB_API \
Expand All @@ -222,7 +222,7 @@ RUN . /buildscripts/bh-set-envvars.sh \

ARG WITH_PDFIUM=yes
RUN if echo "$WITH_PDFIUM" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \
wget -q https://github.com/rouault/pdfium_build_gdal_3_10/releases/download/pdfium_6677_v1/install-ubuntu2004-rev6677.tar.gz \
curl -LO -fsS https://github.com/rouault/pdfium_build_gdal_3_10/releases/download/pdfium_6677_v1/install-ubuntu2004-rev6677.tar.gz \
&& tar -xzf install-ubuntu2004-rev6677.tar.gz \
&& chown -R root:root install \
&& mv install/lib/* /usr/lib/ \
Expand Down Expand Up @@ -258,7 +258,7 @@ ARG ARROW_SOVERSION=1600
RUN . /buildscripts/bh-set-envvars.sh \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V ca-certificates lsb-release wget \
&& wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& curl -LO -fsS https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow${ARROW_SOVERSION}${APT_ARCH_SUFFIX} \
Expand Down Expand Up @@ -353,7 +353,7 @@ RUN apt-get update \
&& ln -s /usr/lib/$(uname -p)-linux-gnu/ogdi/4.1/libvrf.so /usr/lib/$(uname -p)-linux-gnu \
# Install Arrow C++
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V ca-certificates lsb-release wget \
&& wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& curl -LO -fsS https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow${ARROW_SOVERSION} \
Expand Down
4 changes: 2 additions & 2 deletions docker/ubuntu-full/bh-gdal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if [ -z "${GDAL_BUILD_IS_RELEASE:-}" ]; then
fi

mkdir gdal
wget -q "https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz" \
-O - | tar xz -C gdal --strip-components=1
curl -L -fsS "https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz" \
| tar xz -C gdal --strip-components=1



Expand Down
4 changes: 2 additions & 2 deletions docker/ubuntu-full/bh-proj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fi
set -eu

mkdir proj
wget -q "https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz" \
-O - | tar xz -C proj --strip-components=1
curl -L -fsS "https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz" \
| tar xz -C proj --strip-components=1

(
cd proj
Expand Down
8 changes: 4 additions & 4 deletions docker/ubuntu-small/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
ARG OPENJPEG_VERSION=
RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${OPENJPEG_VERSION}" != ""; then ( \
wget -q https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
curl -LO -fsS https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz \
&& tar xzf v${OPENJPEG_VERSION}.tar.gz \
&& rm -f v${OPENJPEG_VERSION}.tar.gz \
&& cd openjpeg-${OPENJPEG_VERSION} \
Expand All @@ -85,7 +85,7 @@ ARG PROJ_INSTALL_PREFIX
ARG PROJ_DATUMGRID_LATEST_LAST_MODIFIED
RUN \
mkdir -p /build_projgrids/${PROJ_INSTALL_PREFIX}/share/proj \
&& curl -LOs http://download.osgeo.org/proj/proj-datumgrid-latest.zip \
&& curl -LO -fsS http://download.osgeo.org/proj/proj-datumgrid-latest.zip \
&& unzip -q -j -u -o proj-datumgrid-latest.zip -d /build_projgrids/${PROJ_INSTALL_PREFIX}/share/proj \
&& rm -f *.zip

Expand All @@ -98,7 +98,7 @@ ARG RSYNC_REMOTE
ARG PROJ_VERSION=master
RUN . /buildscripts/bh-set-envvars.sh \
&& mkdir proj \
&& wget -q https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/OSGeo/PROJ/archive/${PROJ_VERSION}.tar.gz \
| tar xz -C proj --strip-components=1 \
&& cd proj \
&& if test "${RSYNC_REMOTE:-}" != ""; then \
Expand Down Expand Up @@ -158,7 +158,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
export GDAL_SHA1SUM=${GDAL_VERSION}; \
fi \
&& mkdir gdal \
&& wget -q https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz -O - \
&& curl -L -fsS https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz \
| tar xz -C gdal --strip-components=1 \
&& cd gdal \
&& if test "${RSYNC_REMOTE:-}" != ""; then \
Expand Down

0 comments on commit 37ff703

Please sign in to comment.