Created
July 19, 2021 22:58
-
-
Save starlightromero/b0c64430e1ce8c7448dc5410dbc11ef5 to your computer and use it in GitHub Desktop.
Python Dockerfile.distroless
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9-buster as build | |
WORKDIR /usr/src/app | |
RUN apt-get -qq update && \ | |
apt-get -qqy --no-install-recommends install binutils=2.31.1-16 | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir --upgrade pip==21.1.2 && \ | |
pip install --no-cache-dir -r requirements.txt && \ | |
pip install --no-cache-dir pyinstaller==4.3 | |
COPY . . | |
RUN pyinstaller app.py | |
FROM gcr.io/distroless/python3:nonroot | |
WORKDIR /usr/src/app | |
COPY --from=build /usr/src/app/dist ./dist | |
ENTRYPOINT [ "dist/app/app" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment