Skip to content

compile gdal with postgres support #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mtfurlan opened this issue Dec 13, 2021 · 4 comments
Closed

compile gdal with postgres support #273

mtfurlan opened this issue Dec 13, 2021 · 4 comments

Comments

@mtfurlan
Copy link

I want to import a geojson file into a table.
The command I found used ogr2ogr from gdal, but this docker image doesn't compile gdal with postgres support.

Would a PR to compile gdal with postgres support be appreciated?

diff --git a/14-master/Dockerfile b/14-master/Dockerfile
index 8a73ad4..500b757 100644
--- a/14-master/Dockerfile
+++ b/14-master/Dockerfile
@@ -56,7 +56,8 @@ RUN set -ex \
       make \
       pkg-config \
       protobuf-c-compiler \
-      xsltproc
+      xsltproc \
+      libpq-dev
 
 # sfcgal
 ENV SFCGAL_VERSION master
@@ -131,7 +132,7 @@ RUN set -ex \
     fi \
     \
     && ./autogen.sh \
-    && ./configure --disable-static \
+    && ./configure --disable-static --with-pg \
     && make -j$(nproc) \
     && make install \
     && cd / \

If so, which dockerfiles should be modified?

@ImreSamu
Copy link
Member

Would a PR to compile gdal with postgres support be appreciated?

My personal opinion: yes.

  • it can be useful.
  • and as I know - no strict requirements for the "-master" images sizes

But this is only a preliminary opinion; and the final decision is not mine.

If so, which dockerfiles should be modified?

  • Please modify the ./Dockerfile.master.template
  • and refresh your local buildpack-deps docker images with: docker pull buildpack-deps
  • and run: make update
  • and check the changes with : git status
    • at least you should see
      * modified: Dockerfile.master.template
      * modified: 13-master/Dockerfile <--- generated from the template - with the latest commits
      * modified: 14-master/Dockerfile <--- generated from the template - with the latest commits

Please add the "current" and the "new" image size ( so we can calculate the increase )

for example the current size: 891MB

$ docker images postgis/postgis:14-master
REPOSITORY        TAG         IMAGE ID       CREATED        SIZE
postgis/postgis   14-master   a00012b8f66a   12 hours ago   891MB

@mtfurlan
Copy link
Author

14-master goes from 891MB to 898MB (8MB difference) and 13-master from 888MB to 895MB (7MB difference).

What's the difference between $version-master and $version and $version-alpine tagged images, and when should each be used?
It wasn't clear to me from the readme on either github or dockerhub, so I just kinda chose 14-master at random.

I would expect gdal to be compiled with postgres support in all of the images though, as these are docker images specifically for postgis.
Why is gdal even present if it can't talk to postgis?

@ImreSamu
Copy link
Member

What's the difference between $version-master and $version and $version-alpine tagged images, and when should each be used?

imho:

  • "$version" - debian package;
    • pro: matured; recomended for the most users; easy to extend with other debian packages
    • con: older geos, proj, gdal
  • "$version-alpine" - alpine based.
    • pro: minimal image size; recommended for testing.
    • con: musl based; harder to extend.
  • "$version-master" - last "master"/"main" for posgis.geos,gdal dependencies; experimental
    • pro: for testing;
    • con: larger image size. experimental; not easy to extend

I would expect gdal to be compiled with postgres support in all of the images though, as these are docker images specifically for postgis.

imho: please verify - the postgis/postgis:14-3.1 is working?

Why is gdal even present if it can't talk to postgis?

Postgis raster support.
https://github.com/postgis/postgis/search?p=2&q=gdal

@mtfurlan
Copy link
Author

Thanks for the clear summary.

Looks like

  • postgis/postgis:14-3.1
  • ogr2ogr isn't installed, it's in gdal-bin
  • postgis/postgis:14-3.1-alpine
  • ogr2ogr isn't installed, it's in gdal-tools

So I'm thinking maybe we shouldn't worry about the gdal tools being compiled with postgres in this repo, and I'll go extend the debian image on my own.

If anyone feels strongly feel free to reopen, I can still do a PR.

mtfurlan added a commit to mtfurlan/docker-postgis that referenced this issue Dec 13, 2021
Thanks to ImreSamu in issue postgis#273 for writing this summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants