Skip to content

Commit

Permalink
Docker: update ubuntu-small to 24.04 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 25, 2024
1 parent bfe3946 commit c71f687
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
45 changes: 25 additions & 20 deletions docker/ubuntu-small/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# or licensed under MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>

ARG PROJ_INSTALL_PREFIX=/usr/local
ARG BASE_IMAGE=ubuntu:22.04
ARG TARGET_BASE_IMAGE=ubuntu:22.04
ARG BASE_IMAGE=ubuntu:24.04
ARG TARGET_BASE_IMAGE=ubuntu:24.04

FROM $BASE_IMAGE as builder

Expand All @@ -21,18 +21,19 @@ COPY ./bh-set-envvars.sh /buildscripts/bh-set-envvars.sh
RUN . /buildscripts/bh-set-envvars.sh \
&& if test "${TARGET_ARCH}" != ""; then \
rm -f /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse" >> /etc/apt/sources.list \
rm -f /etc/apt/sources.list.d/ubuntu.sources \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu noble-security main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe" >> /etc/apt/sources.list \
&& dpkg --add-architecture ${TARGET_ARCH} \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y g++-11-${GCC_ARCH}-linux-gnu \
&& ln -s ${GCC_ARCH}-linux-gnu-gcc-11 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \
&& ln -s ${GCC_ARCH}-linux-gnu-g++-11 /usr/bin/${GCC_ARCH}-linux-gnu-g++ \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y g++-13-${GCC_ARCH}-linux-gnu \
&& ln -s ${GCC_ARCH}-linux-gnu-gcc-13 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \
&& ln -s ${GCC_ARCH}-linux-gnu-g++-13 /usr/bin/${GCC_ARCH}-linux-gnu-g++ \
&& rm -rf /var/lib/apt/lists/*; \
fi

Expand Down Expand Up @@ -134,10 +135,12 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& ln -s libinternalproj.so.${PROJ_SO} /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO_FIRST} \
&& ln -s libinternalproj.so.${PROJ_SO} /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so \
&& rm /build${PROJ_INSTALL_PREFIX}/lib/libproj.* \
&& ln -s libinternalproj.so.${PROJ_SO} /build${PROJ_INSTALL_PREFIX}/lib/libproj.so.${PROJ_SO} \
&& ln -s libinternalproj.so.${PROJ_SO} /build${PROJ_INSTALL_PREFIX}/lib/libproj.so.${PROJ_SO_FIRST} \
&& ${GCC_ARCH}-linux-gnu-strip -s /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO} \
&& for i in /build${PROJ_INSTALL_PREFIX}/bin/*; do ${GCC_ARCH}-linux-gnu-strip -s $i 2>/dev/null || /bin/true; done
&& for i in /build${PROJ_INSTALL_PREFIX}/bin/*; do ${GCC_ARCH}-linux-gnu-strip -s $i 2>/dev/null || /bin/true; done \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y patchelf \
&& patchelf --set-soname libinternalproj.so.${PROJ_SO_FIRST} /build${PROJ_INSTALL_PREFIX}/lib/libinternalproj.so.${PROJ_SO} \
&& for i in /build${PROJ_INSTALL_PREFIX}/bin/*; do patchelf --replace-needed libproj.so.${PROJ_SO_FIRST} libinternalproj.so.${PROJ_SO_FIRST} $i; done

# Build GDAL
ARG GDAL_VERSION=master
Expand Down Expand Up @@ -172,9 +175,11 @@ RUN . /buildscripts/bh-set-envvars.sh \
fi \
&& mkdir build \
&& cd build \
&& CFLAGS='-DPROJ_RENAME_SYMBOLS -O2' CXXFLAGS='-DPROJ_RENAME_SYMBOLS -DPROJ_INTERNAL_CPP_NAMESPACE -O2' \
# -Wno-psabi avoid 'note: parameter passing for argument of type 'std::pair<double, double>' when C++17 is enabled changed to match C++14 in GCC 10.1' on arm64
&& CFLAGS='-DPROJ_RENAME_SYMBOLS -O2' CXXFLAGS='-DPROJ_RENAME_SYMBOLS -DPROJ_INTERNAL_CPP_NAMESPACE -O2 -Wno-psabi' \
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DGDAL_FIND_PACKAGE_PROJ_MODE=MODULE \
-DPROJ_INCLUDE_DIR="/build${PROJ_INSTALL_PREFIX-/usr/local}/include" \
-DPROJ_LIBRARY="/build${PROJ_INSTALL_PREFIX-/usr/local}/lib/libinternalproj.so" \
-DGDAL_USE_TIFF_INTERNAL=ON \
Expand Down Expand Up @@ -219,19 +224,19 @@ RUN apt-get update -y && apt-get upgrade -y \
RUN apt-get update \
# PROJ dependencies
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libsqlite3-0 libtiff5 libcurl4 \
libsqlite3-0 libtiff6 libcurl4 \
curl unzip ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# GDAL dependencies
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-numpy libpython3.10 \
libjpeg-turbo8 libgeos3.10.2 libgeos-c1v5 \
python3-numpy libpython3.12 \
libjpeg-turbo8 libgeos3.12.1 libgeos-c1v5 \
libexpat1 \
libxerces-c3.2 \
libwebp7 libpng16-16 \
libzstd1 bash libpq5 libssl3 libopenjp2-7 libspatialite7 \
libzstd1 bash libpq5 libssl3 libopenjp2-7 libspatialite8 \
# pil for antialias option of gdal2tiles
python3-pil \
&& rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions docker/ubuntu-small/bh-set-envvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ if test "${TARGET_ARCH:-}" != ""; then
exit 0
fi
export APT_ARCH_SUFFIX=":${TARGET_ARCH}"
export CC=${GCC_ARCH}-linux-gnu-gcc-11
export CXX=${GCC_ARCH}-linux-gnu-g++-11
export CC=${GCC_ARCH}-linux-gnu-gcc-13
export CXX=${GCC_ARCH}-linux-gnu-g++-13
export WITH_HOST="--host=${GCC_ARCH}-linux-gnu"
else
export APT_ARCH_SUFFIX=""
Expand Down

0 comments on commit c71f687

Please sign in to comment.