デフォルト・ビルドのデプロイについて
ファンクションの構築またはデプロイを行うと、OCIファンクションは
func.yaml
ファイルの設定を使用して、Dockerイメージの構築のための命令を含む一時Dockerfileを作成します。Dockerイメージの作成後、OCI Functionsは一時Dockerfileを削除します。
たとえば、一時的なDockerfileを次に示します。
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"]