https://github.com/GoogleContainerTools/distroless

Distroless 基础镜像

谷歌为大多数流行的编程语言和平台提供了 Distroless 的基础镜像。
以下基础镜像是正式发布的版本:

  1. FROM python:2.7-slim AS build
  2. ADD . /app
  3. WORKDIR /app
  4. RUN pip install --upgrade pip
  5. RUN pip install -r ./requirements.txt
  6. FROM gcr.io/distroless/python2.7
  7. COPY --from=build /app /app
  8. COPY --from=build /usr/local/lib/python2.7/site-packages /usr/local/lib/python2.7/site-packages
  9. WORKDIR /app
  10. ENV PYTHONPATH=/usr/local/lib/python2.7/site-packages
  11. EXPOSE 5000
  12. CMD ["app.py"]