Skip to content

Commit

Permalink
docker: Sort package lists and configure options in Dockerfiles (#4373)
Browse files Browse the repository at this point in the history
* docker: Sort packages and configure options in Ubuntu Dockerfiles

* docker: Sort packages and configure options in debian Dockerfile

* docker: Sort packages and configure options in Alpine Dockerfile

* docker: Sort packages and configure options in Ubuntu wxgui Dockerfile
  • Loading branch information
echoix authored Sep 24, 2024
1 parent 234209a commit 8c671ca
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 144 deletions.
104 changes: 55 additions & 49 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ WORKDIR /tmp
ARG GUI

# Todo: re-consider required dev packages for addons (~400MB in dev packages)
ARG GRASS_RUN_PACKAGES="build-essential \
ARG GRASS_RUN_PACKAGES="\
bison \
build-essential \
bzip2 \
curl \
flex \
g++ \
gcc \
gdal-bin \
geos-bin \
proj-bin \
netcdf-bin \
git \
language-pack-en-base \
libcairo2 \
Expand All @@ -38,29 +37,29 @@ ARG GRASS_RUN_PACKAGES="build-essential \
libfftw3-dev \
libfreetype6 \
libgdal-dev \
libgeos-dev \
libgsl-dev \
libgsl27 \
libjpeg-turbo8 \
libjsoncpp-dev \
liblapacke-dev \
libmagic1 \
libmagic-mgc \
libmagic1 \
libncurses5 \
libopenblas-dev \
libomp-dev \
libomp5 \
libopenblas-base \
libopenblas-dev \
libopenjp2-7 \
libomp5 \
libomp-dev \
libgeos-dev \
libpdal-dev \
libproj-dev \
libpq-dev \
libgsl-dev \
libpdal-base13 \
libpdal-dev \
libpdal-plugin-hdf \
libpdal-plugins \
libpdal-util13 \
libpnglite0 \
libpq-dev \
libpq5 \
libproj-dev \
libpython3-all-dev \
libreadline8 \
libsqlite3-0 \
Expand All @@ -71,7 +70,9 @@ ARG GRASS_RUN_PACKAGES="build-essential \
mesa-utils \
moreutils \
ncurses-bin \
netcdf-bin \
pdal \
proj-bin \
proj-data \
python-is-python3 \
python3 \
Expand All @@ -87,56 +88,58 @@ ARG GRASS_RUN_PACKAGES="build-essential \
ENV GRASS_RUN_PACKAGES=${GRASS_RUN_PACKAGES}

# Define build packages
ARG GRASS_BUILD_PACKAGES="cmake \
ARG GRASS_BUILD_PACKAGES="\
cmake \
libbz2-dev \
libcairo2-dev \
libfreetype6-dev \
zlib1g-dev \
libjpeg-dev \
libncurses5-dev \
libnetcdf-dev \
libopenjp2-7-dev \
libreadline-dev \
libjpeg-dev \
libpnglite-dev \
libreadline-dev \
libsqlite3-dev \
libtiff-dev \
libzstd-dev \
libncurses5-dev \
mesa-common-dev \
zlib1g-dev \
"
ENV GRASS_BUILD_PACKAGES=${GRASS_BUILD_PACKAGES}

ARG GRASS_CONFIG="--with-cxx \
ARG GRASS_CONFIG="\
--enable-largefile \
--with-proj-share=/usr/share/proj \
--with-gdal=/usr/bin/gdal-config \
--with-geos \
--with-sqlite \
--with-blas \
--with-bzlib \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-freetype --with-freetype-includes=/usr/include/freetype2/ \
--with-cxx \
--with-fftw \
--with-postgres --with-postgres-includes=/usr/include/postgresql \
--with-netcdf \
--with-zstd \
--with-bzlib \
--with-pdal \
--without-mysql \
--with-blas \
--with-freetype --with-freetype-includes=/usr/include/freetype2/ \
--with-gdal=/usr/bin/gdal-config \
--with-geos \
--with-lapack \
--with-readline \
--with-netcdf \
--with-odbc \
--with-openmp \
--with-pdal \
--with-postgres --with-postgres-includes=/usr/include/postgresql \
--with-proj-share=/usr/share/proj \
--with-readline \
--with-sqlite \
--with-zstd \
--without-mysql \
"

ARG GRASS_PYTHON_PACKAGES="pip \
setuptools \
python-dateutil \
python-magic \
numpy \
ARG GRASS_PYTHON_PACKAGES="\
Pillow \
ply \
matplotlib \
numpy \
pip \
ply \
psycopg2 \
python-dateutil \
python-magic \
setuptools \
"
ENV GRASS_PYTHON_PACKAGES=${GRASS_PYTHON_PACKAGES}

Expand All @@ -148,31 +151,33 @@ ENV GRASS_CONFIG=${GRASS_CONFIG}

FROM common_start as grass_with_gui

ARG GRASS_RUN_PACKAGES="${GRASS_RUN_PACKAGES} adwaita-icon-theme-full \
libglu1-mesa \
libgtk-3-0 \
libnotify4 \
libsdl2-2.0-0 \
libxtst6 \
librsvg2-common \
gettext \
ARG GRASS_RUN_PACKAGES="${GRASS_RUN_PACKAGES} \
adwaita-icon-theme-full \
freeglut3 \
gettext \
libglu1-mesa \
libgstreamer-plugins-base1.0 \
libgtk-3-0 \
libjpeg8 \
libnotify4 \
libpng16-16 \
librsvg2-common \
libsdl2-2.0-0 \
libsm6 \
libtiff5 \
libwebkit2gtk-4.0 \
libxtst6 \
"
# librsvg2-common \
# (fix error (wxgui.py:7782): Gtk-WARNING **: 19:53:09.774:
# Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg.
# This may indicate that pixbuf loaders or the mime database could not be found.)

ARG GRASS_BUILD_PACKAGES="${GRASS_BUILD_PACKAGES} adwaita-icon-theme-full \
ARG GRASS_BUILD_PACKAGES="${GRASS_BUILD_PACKAGES} \
adwaita-icon-theme-full \
freeglut3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
freeglut3-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libjpeg-dev \
Expand All @@ -185,10 +190,11 @@ ARG GRASS_BUILD_PACKAGES="${GRASS_BUILD_PACKAGES} adwaita-icon-theme-full \
libxtst-dev \
"

ARG GRASS_CONFIG="${GRASS_CONFIG} --with-opengl \
--with-x \
ARG GRASS_CONFIG="${GRASS_CONFIG} \
--with-nls \
--with-opengl \
--with-readline \
--with-x \
"
ARG GRASS_PYTHON_PACKAGES="${GRASS_PYTHON_PACKAGES} wxPython"
# If you do not use any Gnome Accessibility features, to suppress warning
Expand Down
36 changes: 18 additions & 18 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ ARG PYTHON_VERSION=3
# List of packages to be installed (proj-data omitted: 570.04 MB)
ENV GRASS_RUN_PACKAGES="\
attr \
build-base \
bash \
bison \
build-base \
bzip2 \
cairo \
curl \
Expand All @@ -29,15 +29,15 @@ ENV GRASS_RUN_PACKAGES="\
gdal-driver-JP2OpenJPEG \
gdal-driver-LIBKML \
gdal-driver-MSSQLSpatial \
gdal-driver-netCDF \
gdal-driver-ODBC \
gdal-driver-PG \
gdal-driver-PNG \
gdal-driver-WMS \
gdal-driver-netCDF \
gdal-tools \
gettext \
geos \
geos-dev \
gettext \
git \
gnutls \
jsoncpp \
Expand All @@ -52,15 +52,15 @@ ENV GRASS_RUN_PACKAGES="\
musl \
musl-utils \
ncurses \
openjpeg \
openblas \
py3-numpy \
py3-pillow \
python3 \
openjpeg \
pdal \
pdal-dev \
postgresql15-client \
proj-util \
py3-numpy \
py3-pillow \
python3 \
sqlite \
sqlite-libs \
subversion \
Expand Down Expand Up @@ -89,23 +89,23 @@ FROM common as build
# set configuration options, without wxGUI
ENV GRASS_CONFIG="\
--enable-largefile \
--with-bzlib \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-cxx \
--with-proj-share=/usr/share/proj \
--with-fftw \
--with-gdal \
--with-pdal \
--with-geos \
--with-openmp \
--with-pdal \
--with-postgres --with-postgres-includes=/usr/include/postgresql \
--with-proj-share=/usr/share/proj \
--with-sqlite \
--with-bzlib \
--with-zstd \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-fftw \
--with-postgres --with-postgres-includes=/usr/include/postgresql \
--with-openmp \
--without-freetype \
--without-opengl \
--without-nls \
--without-mysql \
--without-nls \
--without-odbc \
--without-opengl \
"

# Set environmental variables for GRASS GIS compilation, without debug symbols
Expand All @@ -132,13 +132,13 @@ ENV GRASS_BUILD_PACKAGES="\
libjpeg-turbo-dev \
libpng-dev \
libpq-dev \
openjpeg-dev \
openblas-dev \
openjpeg-dev \
pdal \
pdal-dev \
proj-dev \
python3-dev \
py3-numpy-dev \
python3-dev \
sqlite-dev \
tar \
tiff-dev \
Expand Down
24 changes: 12 additions & 12 deletions docker/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ WORKDIR /tmp

RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends --no-install-suggests \
build-essential \
bison \
build-essential \
bzip2 \
cmake \
curl \
Expand All @@ -40,8 +40,8 @@ RUN apt-get update && apt-get upgrade -y && \
libgsl0-dev \
libjpeg-dev \
libjsoncpp-dev \
libnetcdf-dev \
libncurses-dev \
libnetcdf-dev \
libopenblas-dev \
libopenjp2-7 \
libopenjp2-7-dev \
Expand Down Expand Up @@ -153,24 +153,24 @@ ENV CXXFLAGS "$MYCXXFLAGS"
ENV NUMTHREADS=4
RUN make distclean || echo "nothing to clean"
RUN /src/grass_build/configure \
--with-cxx \
--enable-largefile \
--with-proj-share=/usr/share/proj \
--with-gdal=/usr/bin/gdal-config \
--with-geos \
--with-sqlite \
--with-bzlib \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-freetype --with-freetype-includes="/usr/include/freetype2/" \
--with-cxx \
--with-fftw \
--with-postgres --with-postgres-includes="/usr/include/postgresql" \
--with-freetype --with-freetype-includes="/usr/include/freetype2/" \
--with-gdal=/usr/bin/gdal-config \
--with-geos \
--with-netcdf \
--with-zstd \
--with-bzlib \
--with-pdal \
--with-postgres --with-postgres-includes="/usr/include/postgresql" \
--with-proj-share=/usr/share/proj \
--with-sqlite \
--with-zstd \
--without-mysql \
--without-odbc \
--without-openmp \
--without-opengl \
--without-openmp \
&& make -j $NUMTHREADS \
&& make install && ldconfig

Expand Down
Loading

0 comments on commit 8c671ca

Please sign in to comment.