Skip to content

Commit 577e9af

Browse files
authored
Update Dockerfile
1 parent e696201 commit 577e9af

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

samples/imagedims-python/Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
FROM fnproject/python:3.6-dev
1+
FROM fnproject/python:3.6-dev as build-stage
22
WORKDIR /function
33
ADD requirements.txt /function/
4-
RUN pip3 install --no-cache --no-cache-dir --upgrade pip && \
5-
pip3 install --target /python/ --no-cache --no-cache-dir -r requirements.txt && \
6-
rm -fr ~/.cache/pip /tmp* requirements.txt func.yaml Dockerfile .venv && \
7-
chmod -R o+r /function
4+
5+
RUN pip3 install --target /python/ --no-cache --no-cache-dir -r requirements.txt &&\
6+
rm -fr ~/.cache/pip /tmp* requirements.txt func.yaml Dockerfile .venv &&\
7+
chmod -R o+r /python
88
ADD . /function/
99
RUN rm -fr /function/.pip_cache
10-
1110
FROM fnproject/python:3.6
1211
RUN microdnf install oracle-epel-release-el8 &&\
1312
microdnf install ImageMagick &&\
1413
microdnf remove oracle-epel-release-el8 &&\
1514
microdnf clean all
1615
WORKDIR /function
17-
COPY --from=build-stage /function /function
1816
COPY --from=build-stage /python /python
19-
ENV PYTHONPATH=/python:/function
17+
COPY --from=build-stage /function /function
18+
RUN chmod -R o+r /function
19+
ENV PYTHONPATH=/function:/python
2020
ENTRYPOINT ["/python/bin/fdk", "/function/func.py", "handler"]
21-

0 commit comments

Comments
 (0)