★ wanayoo — archive 1999 https://github.com/nficano/python-lambda/issues/98Nouvelle recherche | Portail wanayoo
Skip to content
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

Package libraries with native dependencies #98

Open
hhunaid opened this issue Feb 21, 2018 · 1 comment
Open

Package libraries with native dependencies #98

hhunaid opened this issue Feb 21, 2018 · 1 comment

Comments

@hhunaid
Copy link

@hhunaid hhunaid commented Feb 21, 2018

I am developing on macOS and want to package Pillow. I have installed and downloaded pillow from an ec2 instance and want it to be packaged instead of the one in site-packages. Right now only way to do is to include PIL in source_directories and uninstall it via pip before packaging.
Is there a better way to do it?

@Birne94
Copy link

@Birne94 Birne94 commented Aug 7, 2018 •

I ran into the same problem today and fell back to using a docker container for building the function package. Something along the lines of the following Dockerfile would do the job (e.g. for Ubuntu 16.04):

FROM ubuntu:xenial

ENV LANG C.UTF-8

RUN apt-get update --fix-missing
RUN apt-get install -y python curl git
RUN apt-get upgrade -y
RUN curl https://bootstrap.pypa.io/get-pip.py | python2
RUN pip install python-lambda

WORKDIR /build
COPY . /build/

# run your build command
CMD lambda build --requirements requirements.txt
docker build -t mylambdacontainer .
docker run -v $(pwd)/dist:/build/dist mylambdacontainer

I mount the dist directory where the packages are created as a volume on my host machine so I can have them in the same place as I would when building natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.