-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
31 lines (26 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Sample Starfleet Dockerfile for building ECR Lambda functions
FROM public.ecr.aws/lambda/python:3.12
ENV LAMBDA_TASK_ROOT=/var/runtime
# Copy Starfleet over:
COPY ./ ${LAMBDA_TASK_ROOT}/starfleet
# Perform cleanup of things the Docker doens't need:
RUN rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/tests && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/.tox && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/.pytest_cache && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/deploy && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/site && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/.kubelr && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/build && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/.coverage && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/*.ini && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/*.yaml && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/*.md && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/sample_samconfig.toml && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/Dockerfile && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/venv && \
rm -Rf ${LAMBDA_TASK_ROOT}/starfleet/env
# Install the specified packages:
RUN cd ${LAMBDA_TASK_ROOT}/starfleet && \
pip install . && \
rm -Rf ${LAMBDA_TASK_ROOT}/boto* # Remove the lambda provided boto since it interferes with starfleet
# The CMD is passed in as ImageConfig in the SAM template