Skip to content
This repository was archived by the owner on Oct 21, 2019. It is now read-only.
This repository was archived by the owner on Oct 21, 2019. It is now read-only.

Allow setting PREFIX at build time #19

Open

Description

@ersinakinci

First of all, thanks so much for putting this together. GDAL is a pain to compile.

I'm using your images with https://github.com/UnitedIncome/serverless-python-requirements to get GDAL working on AWS Lambda. Unfortunately, there's a conflict because both this project's Dockerfile and serverless-python-requirements attempt to use /var/task in the container's file system, the former to install GDAL and the latter to mount a volume. The path is hardcoded in both cases.

Ideally, the mount path should be overridable in serverless-python-requirements. Until then, it wouldn't hurt to make the PREFIX, currently set by a hardcoded ENV in the Dockerfile, overridable at build time by using an ARG. I've created a PR that accomplishes precisely this: #18. The default is still set to /var/task, so it shouldn't break anything.

Activity

  1. changed the title [-]Allow setting PREFIX and build time[/-] [+]Allow setting PREFIX at build time[/+] on Jul 14, 2019
  2. vincentsarago commented on Jul 15, 2019

    @vincentsarago
    Member

    @earksiinni thanks for the issue.

    Sadly this is not a simple as it look. To enable specific libcurl, libjpeg and libpng I had to hardcode the path directly in the shared libray: https://github.com/RemotePixel/amazonlinux-gdal#shared-libraries thus changing this path would break some functionality.

    To make it happens I'll need to re-work on the issue to be able to use $origin as done in https://github.com/developmentseed/geolambda/blob/master/Dockerfile#L200

  3. ersinakinci commented on Jul 15, 2019

    @ersinakinci
    Author

    @vincentsarago this makes a lot of sense! I've been in so deep trying to get my toolchain working that I didn't even think about the rpath for deployed binaries. My particular use case doesn't use the GDAL executables (just the shared libraries), but of course this would be a problem for most people.

    From the link that you posted, it sounds like you'd be open to having two separate variables, one for the PREFIX and another for the rpath. I modified my Dockerfile, based off of yours, to use RPATH_PREFIX for the latter. Or maybe we should stick with ORIGIN, is that idiomatic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions