About Deploying Default Builds

When you build or deploy the function, OCI Functions uses the settings in the func.yaml file to create a temporary Dockerfile containing the instructions from which to build the Docker image. After creating the Docker image, OCI Functions deletes the temporary Dockerfile.

For example, a temporary Dockerfile is shown below.

FROM fnproject/python:3.9-dev as build-stage

WORKDIR /function

ADD requirements.txt /function/

                                           RUN pip3 install --target /python/  --no-cache --no-cache-dir -r requirements.txt &&\

                                               rm -fr ~/.cache/pip /tmp* requirements.txt func.yaml Dockerfile .venv &&\

                                               chmod -R o+r /python

ADD . /function/

RUN rm -fr /function/.pip_cache

FROM fnproject/python:3.9

WORKDIR /function

COPY --from=build-stage /python /python

COPY --from=build-stage /function /function

RUN chmod -R o+r /function

ENV PYTHONPATH=/function:/python

ENTRYPOINT ["/python/bin/fdk", "/function/func.py", "handler"]