Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize docker images for python #362

Merged
merged 2 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.7

COPY app.py requirements.txt ./

COPY requirements.txt ./
RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t .

COPY app.py ./

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.8

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.8 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.8

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.8 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.8

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.8 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ FROM public.ecr.aws/lambda/python:3.8

RUN yum install -y libgomp

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.8 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.8

COPY app.py requirements.txt ./

COPY requirements.txt ./
RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t .

COPY app.py ./

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.9

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.9 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.9

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.9 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.9

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.9 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.9

COPY app.py requirements.txt ./
COPY model /opt/ml/model

COPY requirements.txt ./
RUN python3.9 -m pip install -r requirements.txt -t .

COPY app.py ./
COPY model /opt/ml/model

CMD ["app.lambda_handler"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM public.ecr.aws/lambda/python:3.9

COPY app.py requirements.txt ./

COPY requirements.txt ./
RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t .

COPY app.py ./

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]