A complete Python example is available on the Basics page.
FROM python:3WORKDIR /codedeps:RUN pip install wheelCOPY requirements.txt ./RUN pip wheel -r requirements.txt --wheel-dir=wheelsbuild:FROM +depsCOPY src srcSAVE ARTIFACT src /srcSAVE ARTIFACT wheels /wheelsdocker:COPY +build/src srcCOPY +build/wheels wheelsCOPY requirements.txt ./RUN pip install --no-index --find-links=wheels -r requirements.txtENTRYPOINT ["python3", "./src/hello.py"]SAVE IMAGE python-example:latest
For the complete code see the examples/python GitHub directory.