Skip to content

Instantly share code, notes, and snippets.

@pgilad pgilad/Dockerfile
Last active Jan 2, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.