Skip to content

Instantly share code, notes, and snippets.

@pgilad
Last active January 2, 2019 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgilad/0879210a628e2fb686f993d863ec9ad8 to your computer and use it in GitHub Desktop.
Save pgilad/0879210a628e2fb686f993d863ec9ad8 to your computer and use it in GitHub Desktop.
Dockerfile to create a zip for AWS Lambda code based on Python 2.7 and Pipenv
FROM amazonlinux:latest
RUN yum -y update && yum install -y gcc python-devel zip which
RUN curl https://bootstrap.pypa.io/get-pip.py | python -
RUN pip install pipenv
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV SOURCE_DIR lambdas
WORKDIR /app
COPY Pipfile* ./
RUN pipenv lock -r | sed 's/-e //g' | pip install --upgrade -r /dev/stdin --target .
COPY $SOURCE_DIR ./
RUN find . -type f -iname '*.pyc' -delete && rm Pipfile*
RUN zip -r /tmp/code_amzn_linux.zip .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment