Skip to content

Commit

Permalink
Docker ubuntu-full: update Java to JDK 17 (fixes OSGeo#6949), and avo…
Browse files Browse the repository at this point in the history
…id timeouts when installing arrow/parquet packages [ci skip]
  • Loading branch information
rouault committed May 1, 2023
1 parent 38f48ce commit 0ee8ece
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
19 changes: 15 additions & 4 deletions docker/ubuntu-full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN . /buildscripts/bh-set-envvars.sh \
libtiff5-dev${APT_ARCH_SUFFIX} \
&& rm -rf /var/lib/apt/lists/*

ARG JAVA_VERSION=11
ARG JAVA_VERSION=17
# Setup build env for GDAL
RUN . /buildscripts/bh-set-envvars.sh \
&& apt-get update -y \
Expand Down Expand Up @@ -223,13 +223,21 @@ RUN . /buildscripts/bh-set-envvars.sh \
&& rm -rf /var/lib/apt/lists/*

# Install Arrow C++
ARG ARROW_VERSION=11.0.0-1
# ARROW_SOVERSION to be updated in the "Build final image" section too
ARG ARROW_SOVERSION=1100
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 \
&& 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-dev${APT_ARCH_SUFFIX}=10.0.1-1 libparquet-dev${APT_ARCH_SUFFIX}=10.0.1-1 libarrow-dataset-dev${APT_ARCH_SUFFIX}=10.0.1-1 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow${ARROW_SOVERSION}${APT_ARCH_SUFFIX} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libparquet${ARROW_SOVERSION}${APT_ARCH_SUFFIX} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow-dataset${ARROW_SOVERSION}${APT_ARCH_SUFFIX} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow-dev${APT_ARCH_SUFFIX}=${ARROW_VERSION} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libparquet-dev${APT_ARCH_SUFFIX}=${ARROW_VERSION} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow-dataset-dev${APT_ARCH_SUFFIX}=${ARROW_VERSION} \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update -y \
Expand Down Expand Up @@ -275,7 +283,8 @@ FROM $TARGET_BASE_IMAGE as runner

USER root
RUN date
ARG JAVA_VERSION=11
ARG JAVA_VERSION=17
ARG ARROW_SOVERSION=1100

# Update distro
RUN apt-get update -y && apt-get upgrade -y \
Expand Down Expand Up @@ -311,7 +320,9 @@ 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 libarrow1000 libparquet1000 libarrow-dataset1000 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow${ARROW_SOVERSION} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libparquet${ARROW_SOVERSION} \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -V libarrow-dataset${ARROW_SOVERSION} \
&& rm -rf /var/lib/apt/lists/*

# Attempt to order layers starting with less frequently varying ones
Expand Down
13 changes: 10 additions & 3 deletions docker/ubuntu-full/bh-gdal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,27 @@ wget -q "https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz" \
if test "${GCC_ARCH}" != "x86_64"; then
export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DPDFIUM_INCLUDE_DIR="
fi
if test "${TARGET_ARCH:-}" != ""; then
export JDK_PATH="/usr/lib/jvm/java-${JAVA_VERSION}-openjdk-${TARGET_ARCH}"
export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DJAVA_AWT_INCLUDE_PATH:PATH=${JDK_PATH}/include -DJAVA_AWT_LIBRARY:FILEPATH=${JDK_PATH}/lib/libjawt.so -DJAVA_INCLUDE_PATH:PATH=${JDK_PATH}/include -DJAVA_INCLUDE_PATH2:PATH=${JDK_PATH}/include/linux -DJAVA_JVM_LIBRARY:FILEPATH=${JDK_PATH}/lib/server/libjvm.so"
export JAVA_ARCH=""
if test "${GCC_ARCH}" = "x86_64"; then
export JAVA_ARCH="amd64";
elif test "${TARGET_ARCH}" = "arm64"; then
export JAVA_ARCH="arm64";
fi
if test "${JAVA_ARCH:-}" != ""; then
export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DBUILD_JAVA_BINDINGS=ON -DJAVA_HOME=/usr/lib/jvm/java-${JAVA_VERSION}-openjdk-${JAVA_ARCH}"
fi
if echo "$WITH_FILEGDB" | grep -Eiq "^(y(es)?|1|true)$" ; then
ln -s /usr/local/FileGDB_API/lib/libFileGDBAPI.so /usr/lib/x86_64-linux-gnu
export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DFileGDB_ROOT:PATH=/usr/local/FileGDB_API -DFileGDB_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libFileGDBAPI.so"
export LD_LIBRARY_PATH=/usr/local/FileGDB_API/lib:${LD_LIBRARY_PATH:-}
fi
echo "${GDAL_CMAKE_EXTRA_OPTS}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-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 \
-DBUILD_PYTHON_BINDINGS=ON \
-DGDAL_USE_GEOTIFF_INTERNAL=ON ${GDAL_CMAKE_EXTRA_OPTS}

make "-j$(nproc)"
Expand Down

0 comments on commit 0ee8ece

Please sign in to comment.