From 37ff70389c28228773a1ab3cc1b137ddee2c346d Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Fri, 4 Oct 2024 15:15:56 +0200 Subject: [PATCH] docker: print HTTP errors on failure 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. --- docker/alpine-normal/Dockerfile | 10 +++++----- docker/alpine-small/Dockerfile | 8 ++++---- docker/ubuntu-full/Dockerfile | 20 ++++++++++---------- docker/ubuntu-full/bh-gdal.sh | 4 ++-- docker/ubuntu-full/bh-proj.sh | 4 ++-- docker/ubuntu-small/Dockerfile | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docker/alpine-normal/Dockerfile b/docker/alpine-normal/Dockerfile index 76c6e0373217..44c1fd1bf2ec 100644 --- a/docker/alpine-normal/Dockerfile +++ b/docker/alpine-normal/Dockerfile @@ -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 \ @@ -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} \ @@ -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 \ @@ -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} \ @@ -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 \ diff --git a/docker/alpine-small/Dockerfile b/docker/alpine-small/Dockerfile index e4fc732b8d77..7d0fe217c7d7 100644 --- a/docker/alpine-small/Dockerfile +++ b/docker/alpine-small/Dockerfile @@ -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} \ @@ -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 @@ -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 \ @@ -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 \ diff --git a/docker/ubuntu-full/Dockerfile b/docker/ubuntu-full/Dockerfile index 685d1686ed7b..373ae0d20e65 100644 --- a/docker/ubuntu-full/Dockerfile +++ b/docker/ubuntu-full/Dockerfile @@ -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} \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -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} \ @@ -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} \ @@ -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 \ @@ -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/ \ @@ -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} \ @@ -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} \ diff --git a/docker/ubuntu-full/bh-gdal.sh b/docker/ubuntu-full/bh-gdal.sh index 4524d01ad4f3..da18b6956cc1 100755 --- a/docker/ubuntu-full/bh-gdal.sh +++ b/docker/ubuntu-full/bh-gdal.sh @@ -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 diff --git a/docker/ubuntu-full/bh-proj.sh b/docker/ubuntu-full/bh-proj.sh index 410958247947..2487dfbe8ac8 100755 --- a/docker/ubuntu-full/bh-proj.sh +++ b/docker/ubuntu-full/bh-proj.sh @@ -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 diff --git a/docker/ubuntu-small/Dockerfile b/docker/ubuntu-small/Dockerfile index 7a31cded59cb..bbf53122852f 100644 --- a/docker/ubuntu-small/Dockerfile +++ b/docker/ubuntu-small/Dockerfile @@ -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} \ @@ -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 @@ -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 \ @@ -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 \