Skip to content

Instantly share code, notes, and snippets.

@fwang

fwang/Dockerfile Secret

Created March 22, 2022 02:40
Show Gist options
  • Save fwang/f7309f1b0281fa38ce957a76d8241587 to your computer and use it in GitHub Desktop.
Save fwang/f7309f1b0281fa38ce957a76d8241587 to your computer and use it in GitHub Desktop.
# The correct AWS SAM build image based on the runtime of the function will be
# passed as build arg. The default allows to do `docker build .` when testing.
ARG IMAGE=amazon/aws-sam-cli-build-image-python3.7
FROM $IMAGE
# Ensure rsync is installed
RUN yum -q list installed rsync &>/dev/null || yum install -y rsync
# Upgrade pip (required by cryptography v3.4 and above, which is a dependency of poetry)
RUN pip install --upgrade pip
# Install the dependencies in a cacheable layer
WORKDIR /var/dependencies
COPY Pipfile* pyproject* poetry* requirements.tx[t] sst-deps-install-command.sh cert.file ./
# Install pipenv and poetry so we can create a requirements.txt if we detect pipfile or poetry.lock respectively
RUN pip install pipenv poetry
RUN ./sst-deps-install-command.sh
CMD [ "python" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment