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

Allow setting PREFIX at build time #19

Open
ersinakinci opened this issue Jul 14, 2019 · 2 comments
Open

Allow setting PREFIX at build time #19

ersinakinci opened this issue Jul 14, 2019 · 2 comments

Comments

@ersinakinci
Copy link

ersinakinci commented Jul 14, 2019

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.

@ersinakinci ersinakinci changed the title Allow setting PREFIX and build time Allow setting PREFIX at build time Jul 14, 2019
@vincentsarago
Copy link
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

@ersinakinci
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants