Skip to content

Commit

Permalink
Docker: update Ubuntu-based images to 22.04 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 11, 2022
1 parent c4355a3 commit 383b03f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 86 deletions.
10 changes: 7 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ See [alpine-small/Dockerfile](alpine-small/Dockerfile)

See [alpine-normal/Dockerfile](alpine-normal/Dockerfile)

# Ubuntu based (20:04 / focal)
# Ubuntu based

Ubuntu version:
* 20.04 for GDAL 3.4 and 3.5
* 22.04 for GDAL 3.6dev

## Small: `osgeo/gdal:ubuntu-small-latest`

Expand All @@ -46,7 +50,7 @@ See [alpine-normal/Dockerfile](alpine-normal/Dockerfile)
* Using internal libtiff and libgeotiff
* External libraries enabled: libsqlite3, libproj, libcurl, libjpeg, libpng, libwebp,
libzstd, libexpat, libxerces-c, libpq, libssl, libgeos, libspatialite
* GDAL Python (Python 3.8)
* GDAL Python (Python 3.8 for Ubuntu 20.04, Python 3.10 for Ubuntu 22.04)
* Base PROJ grid package (http://download.osgeo.org/proj/proj-datumgrid-1.8.zip)
* Overall licensing terms of the GDAL build: LGPL + permissive (MIT, BSD style, Apache, etc..)

Expand All @@ -61,7 +65,7 @@ See [ubuntu-small/Dockerfile](ubuntu-small/Dockerfile)
* External libraries enabled: small + libnetcdf, libhdf4, libhdf5, libtiledb, libkea,
mongocxx 3.4, libspatialite, unixodbc, libxml2, libcfitsio, libmysqlclient,
libkml, libpoppler, pdfium, openexr, libheif, libdeflate
* GDAL Python (Python 3.8)
* GDAL Python (Python 3.8 for Ubuntu 20.04, Python 3.10 for Ubuntu 22.04)
* *All* PROJ grid packages (equivalent of latest of proj-data-X.zip from http://download.osgeo.org/proj/ at time of generation, > 500 MB)
* Overall licensing terms of the GDAL build: copy-left (GPL) + LGPL + permissive

Expand Down
88 changes: 25 additions & 63 deletions docker/ubuntu-full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Public domain
# or licensed under MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>

ARG BASE_IMAGE=ubuntu:20.04
ARG TARGET_BASE_IMAGE=ubuntu:20.04
ARG BASE_IMAGE=ubuntu:22.04
ARG TARGET_BASE_IMAGE=ubuntu:22.04

FROM $BASE_IMAGE as builder

Expand All @@ -20,18 +20,18 @@ 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/ focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse" >> /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 \
&& dpkg --add-architecture ${TARGET_ARCH} \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y g++-9-${GCC_ARCH}-linux-gnu \
&& ln -s ${GCC_ARCH}-linux-gnu-gcc-9 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \
&& ln -s ${GCC_ARCH}-linux-gnu-g++-9 /usr/bin/${GCC_ARCH}-linux-gnu-g++; \
&& 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++; \
fi

# Setup build env for PROJ
Expand All @@ -56,7 +56,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
curl libxml2-dev${APT_ARCH_SUFFIX} libexpat-dev${APT_ARCH_SUFFIX} libxerces-c-dev${APT_ARCH_SUFFIX} \
libnetcdf-dev${APT_ARCH_SUFFIX} libpoppler-dev${APT_ARCH_SUFFIX} libpoppler-private-dev${APT_ARCH_SUFFIX} \
libspatialite-dev${APT_ARCH_SUFFIX} swig ant libhdf4-alt-dev${APT_ARCH_SUFFIX} libhdf5-serial-dev${APT_ARCH_SUFFIX} \
libfreexl-dev${APT_ARCH_SUFFIX} unixodbc-dev${APT_ARCH_SUFFIX} libwebp-dev${APT_ARCH_SUFFIX} libepsilon-dev${APT_ARCH_SUFFIX} \
libfreexl-dev${APT_ARCH_SUFFIX} unixodbc-dev${APT_ARCH_SUFFIX} mdbtools-dev${APT_ARCH_SUFFIX} libwebp-dev${APT_ARCH_SUFFIX} \
liblcms2-2 libpcre3-dev${APT_ARCH_SUFFIX} libcrypto++-dev${APT_ARCH_SUFFIX} libfyba-dev${APT_ARCH_SUFFIX} \
libkml-dev${APT_ARCH_SUFFIX} libmysqlclient-dev${APT_ARCH_SUFFIX} libogdi-dev${APT_ARCH_SUFFIX} \
libcfitsio-dev${APT_ARCH_SUFFIX} openjdk-"$JAVA_VERSION"-jdk${APT_ARCH_SUFFIX} libzstd-dev${APT_ARCH_SUFFIX} \
Expand Down Expand Up @@ -86,7 +86,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& for i in /build_thirdparty/usr/bin/*; do strip -s $i 2>/dev/null || /bin/true; done

# Build mongo-c-driver
ARG MONGO_C_DRIVER_VERSION=1.17.6
ARG MONGO_C_DRIVER_VERSION=1.21.1
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 - \
Expand All @@ -105,7 +105,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& for i in /build_thirdparty/usr/bin/*; do strip -s $i 2>/dev/null || /bin/true; done

# Build mongocxx
ARG MONGOCXX_VERSION=3.6.5
ARG MONGOCXX_VERSION=3.6.7
RUN . /buildscripts/bh-set-envvars.sh \
&& mkdir mongocxx \
&& wget -q https://github.com/mongodb/mongo-cxx-driver/archive/r${MONGOCXX_VERSION}.tar.gz -O - \
Expand All @@ -123,14 +123,12 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& for i in /build_thirdparty/usr/bin/*; do strip -s $i 2>/dev/null || /bin/true; done

# Build tiledb
COPY ./tiledb-5cad65f4c.patch /buildscripts/tiledb-5cad65f4c.patch
ARG TILEDB_VERSION=2.3.1
ARG TILEDB_VERSION=2.8.2
RUN . /buildscripts/bh-set-envvars.sh \
&& mkdir tiledb \
&& wget -q https://github.com/TileDB-Inc/TileDB/archive/${TILEDB_VERSION}.tar.gz -O - \
| tar xz -C tiledb --strip-components=1 \
&& cd tiledb \
&& patch -p1 < /buildscripts/tiledb-5cad65f4c.patch \
&& mkdir build_cmake \
&& cd build_cmake \
&& ../bootstrap --prefix=/usr --disable-werror \
Expand Down Expand Up @@ -163,38 +161,6 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& rm -rf openjpeg-${OPENJPEG_VERSION} \
); fi

# Install MDB Driver Jars
RUN . /buildscripts/bh-set-envvars.sh \
&& wget -q https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mdb-sqlite/mdb-sqlite-1.0.2.tar.bz2 \
&& tar -xjf mdb-sqlite-1.0.2.tar.bz2 \
&& mkdir -p /build/usr/share/java \
&& cp mdb-sqlite-1.0.2/lib/*.jar /build/usr/share/java \
&& rm -rf mdb-sqlite-1.0.2.tar.bz2 && rm -rf mdb-sqlite-1.0.2

# Build recent mdbtools
# Patch to fix an issue with SELECT COUNT(*). See https://github.com/OSGeo/gdal/pull/4104
COPY ./mdbtools-lexer.patch /buildscripts/mdbtools-lexer.patch
RUN . /buildscripts/bh-set-envvars.sh \
&& wget -q https://github.com/mdbtools/mdbtools/releases/download/v0.9.3/mdbtools-0.9.3.tar.gz \
&& tar xzf mdbtools-0.9.3.tar.gz \
&& apt-get update -y \
&& apt-get install -y --fix-missing --no-install-recommends bison flex gawk \
&& rm -rf /var/lib/apt/lists/* \
&& cd mdbtools-0.9.3 \
&& patch -p0 < /buildscripts/mdbtools-lexer.patch \
&& ./configure --with-unixodbc=/usr "${WITH_HOST}" \
&& make -j$(nproc) \
&& mkdir -p /build_thirdparty/usr/lib/${GCC_ARCH}-linux-gnu/odbc \
&& mkdir -p /build_thirdparty/lib/${GCC_ARCH}-linux-gnu \
&& cp ./src/odbc/.libs/libmdbodbc.so /build_thirdparty/usr/lib/${GCC_ARCH}-linux-gnu/odbc \
&& cp ./src/libmdb/.libs/libmdb.so.3 /build_thirdparty/lib/${GCC_ARCH}-linux-gnu \
&& cp ./src/sql/.libs/libmdbsql.so.3 /build_thirdparty/lib/${GCC_ARCH}-linux-gnu \
&& cd .. \
&& rm -rf mdbtools-0.9.3*

#Set CLASSPATH so jars are found
ENV CLASSPATH="/build/usr/share/java/jackcess-1.1.14.jar:/build/usr/share/java/commons-logging-1.1.1.jar:/build/usr/share/java/commons-lang-2.4.jar"

#Build File Geodatabase

ARG WITH_FILEGDB=
Expand Down Expand Up @@ -300,15 +266,15 @@ RUN apt-get update \
# GDAL dependencies
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libopenjp2-7 libcairo2 python3-numpy \
libpng16-16 libjpeg-turbo8 libgif7 liblzma5 libgeos-3.8.0 libgeos-c1v5 \
libpng16-16 libjpeg-turbo8 libgif7 liblzma5 libgeos3.10.2 libgeos-c1v5 \
libxml2 libexpat1 \
libxerces-c3.2 libnetcdf-c++4 netcdf-bin libpoppler97 libspatialite7 gpsbabel \
libhdf4-0-alt libhdf5-103 libhdf5-cpp-103 poppler-utils libfreexl1 unixodbc libwebp6 \
libepsilon1 liblcms2-2 libpcre3 libcrypto++6 libfyba0 \
libxerces-c3.2 libnetcdf-c++4 netcdf-bin libpoppler118 libspatialite7 gpsbabel \
libhdf4-0-alt libhdf5-103 libhdf5-cpp-103 poppler-utils libfreexl1 unixodbc mdbtools libwebp7 \
liblcms2-2 libpcre3 libcrypto++8 libfyba0 \
libkmlbase1 libkmlconvenience1 libkmldom1 libkmlengine1 libkmlregionator1 libkmlxsd1 \
libmysqlclient21 libogdi4.1 libcfitsio8 openjdk-"$JAVA_VERSION"-jre \
libzstd1 bash bash-completion libpq5 libssl1.1 \
libarmadillo9 libpython3.8 libopenexr24 libheif1 \
libmysqlclient21 libogdi4.1 libcfitsio9 openjdk-"$JAVA_VERSION"-jre \
libzstd1 bash bash-completion libpq5 libssl3 \
libarmadillo10 libpython3.10 libopenexr25 libheif1 \
libdeflate0 libblosc1 liblz4-1 \
libbrotli1 \
python-is-python3 \
Expand All @@ -319,13 +285,12 @@ RUN apt-get update \
&& 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 \
&& 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 libarrow700 libparquet700 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow800 libparquet800 \
&& rm -rf /var/lib/apt/lists/*

# Attempt to order layers starting with less frequently varying ones

COPY --from=builder /build_thirdparty/usr/ /usr/
COPY --from=builder /build_thirdparty/lib/ /lib/

ARG PROJ_INSTALL_PREFIX=/usr/local
COPY --from=builder /tmp/proj_grids/* ${PROJ_INSTALL_PREFIX}/share/proj/
Expand All @@ -335,13 +300,10 @@ COPY --from=builder /build${PROJ_INSTALL_PREFIX}/include/ ${PROJ_INSTALL_PREFIX
COPY --from=builder /build${PROJ_INSTALL_PREFIX}/bin/ ${PROJ_INSTALL_PREFIX}/bin/
COPY --from=builder /build${PROJ_INSTALL_PREFIX}/lib/ ${PROJ_INSTALL_PREFIX}/lib/

COPY --from=builder /build/usr/share/java /usr/share/java
#COPY --from=builder /build/usr/share/java /usr/share/java
COPY --from=builder /build/usr/share/gdal/ /usr/share/gdal/
COPY --from=builder /build/usr/include/ /usr/include/
COPY --from=builder /build_gdal_python/usr/ /usr/
COPY --from=builder /build_gdal_version_changing/usr/ /usr/

RUN ldconfig

#Set CLASSPATH so jars are found
ENV CLASSPATH="/usr/share/java/jackcess-1.1.14.jar:/usr/share/java/commons-logging-1.1.1.jar:/usr/share/java/commons-lang-2.4.jar"
4 changes: 2 additions & 2 deletions docker/ubuntu-full/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-9
export CXX=${GCC_ARCH}-linux-gnu-g++-9
export CC=${GCC_ARCH}-linux-gnu-gcc-11
export CXX=${GCC_ARCH}-linux-gnu-g++-11
export WITH_HOST="--host=${GCC_ARCH}-linux-gnu"
else
export APT_ARCH_SUFFIX=""
Expand Down
32 changes: 16 additions & 16 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:20.04
ARG TARGET_BASE_IMAGE=ubuntu:20.04
ARG BASE_IMAGE=ubuntu:22.04
ARG TARGET_BASE_IMAGE=ubuntu:22.04

FROM $BASE_IMAGE as builder

Expand All @@ -21,18 +21,18 @@ 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/ focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list \
&& echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse" >> /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 \
&& dpkg --add-architecture ${TARGET_ARCH} \
&& apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y g++-9-${GCC_ARCH}-linux-gnu \
&& ln -s ${GCC_ARCH}-linux-gnu-gcc-9 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \
&& ln -s ${GCC_ARCH}-linux-gnu-g++-9 /usr/bin/${GCC_ARCH}-linux-gnu-g++; \
&& 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++; \
fi

# Setup build env for PROJ
Expand Down Expand Up @@ -218,12 +218,12 @@ RUN apt-get update; \
# GDAL dependencies
RUN apt-get update -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-numpy libpython3.8 \
libjpeg-turbo8 libgeos-3.8.0 libgeos-c1v5 \
python3-numpy libpython3.10 \
libjpeg-turbo8 libgeos3.10.2 libgeos-c1v5 \
libexpat1 \
libxerces-c3.2 \
libwebp6 libpng16-16 \
libzstd1 bash libpq5 libssl1.1 libopenjp2-7 libspatialite7
libwebp7 libpng16-16 \
libzstd1 bash libpq5 libssl3 libopenjp2-7 libspatialite7

RUN apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y python-is-python3
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-9
export CXX=${GCC_ARCH}-linux-gnu-g++-9
export CC=${GCC_ARCH}-linux-gnu-gcc-11
export CXX=${GCC_ARCH}-linux-gnu-g++-11
export WITH_HOST="--host=${GCC_ARCH}-linux-gnu"
else
export APT_ARCH_SUFFIX=""
Expand Down

0 comments on commit 383b03f

Please sign in to comment.