-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 1.29 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ARG DEBIAN_VERSION=bookworm
ARG SHIMMY_VERSION=latest
ARG PYTHON_VERSION=3.11
FROM ghcr.io/lambda-feedback/shimmy:${SHIMMY_VERSION} AS shimmy
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_VERSION} AS base
# set common workdir
WORKDIR /app
# Install git so we can install python packages from git repositories
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
FROM base AS lambda-rie
# Install the AWS Lambda Runtime Interface Emulator
RUN case $(uname -m) in \
"aarch64") export RIE_BINARY_NAME="aws-lambda-rie-arm64" ;; \
*) export RIE_BINARY_NAME="aws-lambda-rie" ;; \
esac && \
curl -Lo /usr/local/bin/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/${RIE_BINARY_NAME} && \
chmod +x /usr/local/bin/aws-lambda-rie
FROM base
# Install git so we can install python packages from git repositories
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
ENV LOG_FORMAT="production"
# add shimmy
COPY --from=shimmy /shimmy /usr/local/bin/shimmy
# add aws-lambda-rie
COPY --from=lambda-rie /usr/local/bin/aws-lambda-rie /usr/local/bin/aws-lambda-rie
# Copy the entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "shimmy" ]