docker-postgis icon indicating copy to clipboard operation
docker-postgis copied to clipboard

WIP: build-arg api v1 proposal

Open ImreSamu opened this issue 3 years ago • 0 comments

Experiment / Work in Progress

Creating customized PostGIS docker images via build arg ( debian based )

  • this is an improved version of my first proposal https://github.com/postgis/docker-postgis/issues/233#issuecomment-820926170

expected calling

git clone https://github.com/postgis/docker-postgis.git
cd docker-postgis
#optional:    ./update.sh

# customized local build ( for the 3rd party users )
docker build --pull \
  --build-arg PGIS_API_VERSION=v1 \
  \
  --build-arg PGIS_V1_BASE_IMAGE=postgres:13 \
  \
  --build-arg PGIS_V1_SFCGAL_CHECKOUT=tags/v1.3.10 \
  --build-arg PGIS_V1_PROJ_CHECKOUT=tags/8.1.0 \
  --build-arg PGIS_V1_GEOS_CHECKOUT=tags/3.8.2 \
  --build-arg PGIS_V1_GDAL_CHECKOUT=tags/v3.2.3 \
  --build-arg PGIS_V1_POSTGIS_CHECKOUT=main \
  \
  -t postgis:pg13-pgis-main \
  ./13-master/.
  • Life cycle rule1: changes expected .. watch the repo!

  • Life cycle rule2: If the repository changes the API to "v2"

    • the PGIS_API_VERSION=v1 calling should FAIL.
    • the v2 args will be "PGIS_V2_<....>"
  • the PGIS_V1_<...>_CHECKOUT= can be any git checkout parameter:

    • <commit>
    • <branch>
    • <git tags>
  • You should check the PostGIS compatibility and support matrix

API v1 build-arg parameters

# Mandatory:
ARG PGIS_API_VERSION=v1

# Optional parameters - with defaults.
ARG PGIS_V1_BASE_IMAGE=postgres:13

ARG PGIS_V1_SFCGAL_REPOSITORY=https://gitlab.com/Oslandia/SFCGAL.git
ARG PGIS_V1_PROJ_REPOSITORY=https://github.com/OSGeo/PROJ.git
ARG PGIS_V1_GEOS_REPOSITORY=https://github.com/libgeos/geos.git
ARG PGIS_V1_GDAL_REPOSITORY=https://github.com/OSGeo/gdal.git
ARG PGIS_V1_POSTGIS_REPOSITORY=https://git.osgeo.org/gitea/postgis/postgis.git

ARG PGIS_V1_SFCGAL_CHECKOUT=
ARG PGIS_V1_PROJ_CHECKOUT=
ARG PGIS_V1_GEOS_CHECKOUT=
ARG PGIS_V1_GDAL_CHECKOUT=
ARG PGIS_V1_POSTGIS_CHECKOUT=

ARG PGIS_V1_BOOST_VERSION=
ARG PGIS_V1_CDAL_VERSION=

Open question:

  • renaming the 'Dockerfile.master.template' to Dockerfile.main.template ??

ToDo :

  • [ ] add an option for install from package vs. build ( now only the "build" supported )
  • [ ] testing
  • [ ] community discussions / implement feedback ... or drop the proposal
  • [ ] minimal documentation

ImreSamu avatar Jul 04 '21 03:07 ImreSamu