How do I reduce a python (docker) image size using a multi-stage build?
ok so my solution is using wheel, it lets us compile on first image, create wheel files for all dependencies and install them in the second image, without installing the compilers FROM python:2.7-alpine as base RUN mkdir /svc COPY . /svc WORKDIR /svc RUN apk add –update \ postgresql-dev \ gcc \ musl-dev \ linux-headers … Read more